CSHTML file is not compiled anymore

1k views Asked by At

While working on an ASP.NET MVC application, I meet the good old "The current source code is different from the version built into App_Web_blahblah.dll" when I'm trying to debug a CSHTML file, whatever I do (deleting Temporary ASP.NET files, PDBs, cleaning and rebuilding, etc).

What's more disturbing is that the related CSHTML page isn't compiled anymore. I mean, the application keeps showing an old version of the page, even if this one has changed.

There's no errors on this page (the same source code works OK on another machine). Even if there were, I would get a YSOD and that's it.

More importantly, it keeps displaying data that isn't in the source code anymore, and even if I cleaned the temporary files and DLLs everywhere before, so I can't work on this page anymore.

I checked there and there, but none of the answers solved the problem.

So my question is simple : where can the application find code that isn't anywhere (AFAIK) ? Is there another location that I'm not aware of where compiled files can be stored ? What's happening ?

1

There are 1 answers

0
Paweł Reszka On BEST ANSWER

My comment helped so I will write an answer.

This error was caused adding to project file from another destination. You were modifying file which wasn't in correct folder, but old one was still there. Application was running the old one, because it isn't looking at csproj file, but only at files there are placed exactly in Views folder.