简体   繁体   中英

How to debug ASP.Net MVC in Visual Studio 2019


I was hunting a phantom-problem, until I recognized that the debugging wasn't working as expected.

I tried to debug some controller-code (c#) in my ASP.Net application and for this, I stopped the excecution, using a breakpoint (F9).

I started debugging with F5 and the code stopped, as expected at the breakpoint. There, I tried to fetch some data, using different approaches. None of the tries gave me the expected result so after a while, I recognized, that with every excecution the same compiled code is used and not the code, I was watching (and changing) in the editor.

I'm pretty sure, that in VS2017 it worked that way, so I could change the code while excecution.
How can I debug the C# code (and change the code) while excecution?

Thanks

You can do it in Vs2019 by In Tools > Options > (or Debug > Options) > Debugging > General, select Edit and Continue in the right pane.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM