When we do website development, usually write a function to be tested, Visual studio on the point "Start Debugging" (Shortcut is F5), this is the debug mode, there is a direct operation mode, "Start Without Debugging" ( Shortcut key is Ctrl+f5), the website launches, and by default will open a browser window to let you see the results, if you find a problem at this time, need to adjust the code ...
For non-*.cs files
If it is a non-C # file such as cshtml, ASPX, ashx, or asmx (*.cs), whether it is debug or non-debug mode, direct point saving, it takes effect, the site refreshes the page, the first time you access them, they will automatically be compiled, regenerate executable code.
For *.cs files (debug mode)
If you try to modify the CS file in debugging, you get an error message:
You have to suspend the program before you can modify it, there are two ways to pause, one is a breakpoint, the program ran to the breakpoint automatically paused, the other is the direct point "Break All" (shortcut is Ctrl+alt+break), suspended the program, you can modify the CS file, After the modification, click "Continue" (shortcut key F5), it is effective, the magic is: you do not even need to save the point.
For *.cs files (non-debug mode)
You can directly modify CS file, no problem, save, see if it works? --whether the answer. Because the container carrying your program--iis Express does not know that you have modified the source code, you need to recompile, click "Build Solution" (shortcut key F7), and then take effect. Of course, for non-ASP. NET programs, this does not work, because the program runs, EXE files are write-protected, which is not the same as the operation of the ASP.
We hope that through these ways, we can improve the efficiency of website development.
Asp. NET development to modify the code without restarting the site