Q
Q
Quark2021-11-15 01:59:00
visual studio
Quark, 2021-11-15 01:59:00

Why does the "cannot open file" error occur?

The situation was like this:
I started the debugger and changed the code without turning it off. After that, without turning off the debugger, I recompiled it (they warned me about something else, but I didn’t read it carefully, I just recompiled it). After that, an error occurred in which it was written that "Game.exe" (my console program) cannot be edited. I immediately thought about the antivirus, because it has already happened because of him, and more than once. But no, this time it's not his fault. After reading the solution suggested by VS, I went to Debug->Options and turned off "Require source files to exactly match the original version". After that, I was able to run my program, but it turned out that my changes did not affect anything. My program seems to be stuck on some version. After that, I re-enabled "Require source files to exactly match the original version", but now I got a different error: "cannot open file ...Debug\Game.exe". The console itself cannot open, although there is a console along the way.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
Wataru, 2021-11-15
@wataru

In Windows, executables cannot be changed while they are running. When you run the program in the debugger, it is still running, just paused.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question