Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Edit and Continue using a Local IIS

Is it possible to have the Edit and Continue option enabled on Visual Studio when debugging using Local IIS instead of IIS express?

like image 315
user3489866 Avatar asked May 04 '17 14:05

user3489866


People also ask

What is the primary benefit of Edit and Continue functionality?

Edit and Continue is a time-saving feature that enables you to make changes to your source code while your program is in break mode. When you resume execution of the program by choosing an execution command like Continue or Step, Edit and Continue automatically applies the code changes with some limitations.

How do I stop debugging in Visual Studio?

To end a debugging session in Microsoft Visual Studio, from the Debug menu, choose Stop Debugging.

How do I enable debugging in Visual Studio?

In the Visual Studio toolbar, make sure the configuration is set to Debug. To start debugging, select the profile name in the toolbar, such as <project profile name>, IIS Express, or <IIS profile name> in the toolbar, select Start Debugging from the Debug menu, or press F5.


2 Answers

Works in IIS 10.0 (Win 10):

In Administrator command line run

C:\Windows\System32\inetsrv>appcmd set apppool "DefaultAppPool" /+environmentVariables.add[@start,name='COMPLUS_ForceEnC',value='1']

(replace DefaultAppPool with app pool name you're using)

This will add tag

    <environmentVariables> 
        <add name="COMPLUS_ForceEnC" value="1" /> 
    </environmentVariables> 

into C:\Windows\System32\inetsrv\config\applicationHost.config for your app pool, so the app pool process always runs in Edit and Continue mode.

More on the COMPLUS_ForceEnC environment variable can be found here.

See also IIS Configuration Reference

like image 136
Ondrej Avatar answered Oct 16 '22 16:10

Ondrej


Based on Ondrej answer, here is a simple code to enable edit-and-continue on all your application-pools in one click:

SET "APPCMD=%systemroot%\system32\inetsrv\AppCmd.exe"
FOR /F "TOKENS=*" %%f IN ('%APPCMD% list apppool /text:name') DO %APPCMD% set apppool "%%~f" /+environmentVariables.add[@start,name='COMPLUS_ForceEnC',value='1']
PAUSE

save this code as "Enable Edit And Continue.bat" and run it (right click on the file and choose "Run as Administrator").

Enjoy!

like image 5
Micha Kaufman Avatar answered Oct 16 '22 17:10

Micha Kaufman