Asp. NET development to modify the code without restarting the site

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.