Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why would my machine need a full IIS reset to see code changes to an ASP.NET project?

I've noticed that a VS2010 C# website project I'm working on seems to always need an iisreset to be able to see changes I make to the code behind files in the project. I notice that it doesn't have the right version of the assembly because when I try to debug Visual Studio won't let me put break points in the code files I've changed.

I would have thought that doing a application pool restart would be enough but our post build steps do that and it doesn't seem to be enough.

Might there be something not configured incorrectly on my machine or in the project to make this happen?

like image 872
Helephant Avatar asked Jul 08 '10 09:07

Helephant


People also ask

What is IIS reset?

What does IISRESET do? IISRESET restarts all IIS services, shutting down any active IIS worker processes in the process and killing them if they do not stop in time. During the restart, the web server stops listening for incoming requests and causes downtime for all websites on the server.

How do I debug IIS in Visual Studio?

In the Visual Studio toolbar, make sure the configuration is set to Debug, and either IIS Express, or the new IIS profile name, appears in the emulator field. To start debugging, select IIS Express or <IIS profile name> in the toolbar, select Start Debugging from the Debug menu, or press F5.

How long does IIS restart take?

The IISReset command-line utility waits up to one minute for all services to stop. If the services cannot be stopped within one minute, all IIS services are terminated, and IIS restarts.


1 Answers

-I assume that you run asp.net 4-

In the web.config this is the values for debuging that make the less compilations

<compilation debug="true" batch="false" optimizeCompilations="true"
  defaultLanguage="C#" targetFramework="4.0">

You can change the batch, or the optimizeCompilations, to see if your problem solved.

Now I will tell you some other reason that I have notice.

When you have a function with default parametres like

foo(int cValueA, int cValueB = 23)

and for some reason you change it to

foo(int cValueA, int cValueB = 23, int cValueC = 34)

or to

foo(int cValueA)

all calls to that function with a single value, can not catch the update of your function, so they use the old code. One way to solve this, and what I do, is to search all reference to that function and just open the file, add a space on the end and save it, so this way I change the datetime of the file to give to compiler a note that needs update.

like image 65
Aristos Avatar answered Oct 17 '22 07:10

Aristos