Domanda

I'm working on a project in C# where the code relies on polling a web server for a report, this can take anywhere from minutes to an hour to generate and respond. I'd like to be able to run my project and see how it responds, but also continue working on other parts of the code. I don't want to do Edit&Continue, because that will pause or modify what I'm running.

I've tried running it in Release mode so I'm not debugging, but Visual Studio still complains that I cannot edit code while debugging. Any advice? Is this possible?

Thank you in advance for any help or information.

È stato utile?

Soluzione

When you F5 a project, whether it's Debug or Release, Visual Studio will attach to the process, locking the file. Try running without attaching (Ctrl+F5).

A rebuild will try to overwrite your executable, which probably can't be done because it's locked while running, even without the debugger attached. This way you can't compile or debug your newer version while the older one is running.

Deploy the executable somewhere else, run it, attach to it using another instance of Visual Studio and continue editing in your first instance.

Altri suggerimenti

Run with Ctrl-F5 rather than F5 (or the Run button). This is "Start Without Debugging," also available from the Debug menu.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top