views:

65

answers:

2

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?

+1  A: 

-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.

Aristos
A: 

IIS is optimized for production environment where the deployed files dont change in the runtime. If that is the case IIS has to regularly poll and reload the dlls during execution. Which is a rare case in production ad also will degrade the performance substantially. Normally during development use the test web server provided with VS2010. That is optimized for development. Use the right tool for right purpose.

ferosekhanj
We try to make our development environment as close to production as we can to catch environmental errors.
Helephant