views:

241

answers:

3

I am using ASP.Net with VS 2010. Actually i am getting crazy from the compiler. When i change my code and run the project, most of the time an old version of my code is executed. This means that the website is not compiled and the dll's are old. I tried to clean and rebuild my solution many times, some times it worked, others not.I had to close VS to make it run properly (not all the time). Actually i faced this problem when using VS 2005 but not very much. Is there an option to make the solution rebuild -really- each time? By the way, most of the times break point are not reached because the pdb files are old.

A: 

Maybe if you try this option

<compilation optimizeCompilations="false"  batch="false" >

Because in dot.net 4 and vs 2010 they not recompile the pages if function on dll not have been change, what I do to avoid this problem, is that in some functions that I change, and I know that they maybe cause this problem, I make a search for all reference in pages, then I open this pages that have the reference open them, add a space, save them and close them, so compiler know that needs update.

In my case this problem is appear on functions with default value. (new in dot net 4)

Aristos
+1  A: 

Are you setting breakpoints in code from a project that is not set to build in the solution? You can set your website to build every time you debug (Website Properties -> Build -> Start action). Check your solution configuration to make sure all relevant projects are built when you debug (Solution properties -> Configuration Properties: set 'Build' checkbox next to project). Also make sure you are building all the projects as debug. Try going to the project properties-> Compile -> Advanced Compile Options -> Generate debug info: Full.

brheal
A: 

On older versions of VS, deleting temporary files on C:\Windows\Microsoft.NET\Framework\v4.0.30319 it worked since it was caching older versions of code. But on .NET 4.0 seems to not work... The solution posted by Aristos worked like a charm for me.

So the solution stands for:

<compilation optimizeCompilations="false" batch="false" >