ComplX
ComplX

Reputation: 41

a copy of index.cshtml was found in App_Web_*.dll, but the correct source code is different from the version built into App_Web_*.dll,

Hi I've been stuck on this problem all day and was hoping for some guidance.

The file index.cshtml is within my Views folder, the code is within that page. the DLL is not directly referenced in my project referrences.

I've tried the following things:

-Clean and rebuild Project
-delete bin and obj directory
-removed tmp .net directories:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files
- Unticked "Only build startup projects and dependencies on Run,
- Cleared SymbolCache here \AppData\Local\Temp\SymbolCache
-Removed and re-added the view from the project
- Check the project configuration properties to ensure its set to build
- ensure its in debug mode.
- run through localIIS web server and IISExpress

I'm all out of ideas. Even after i clear the Temp asp.net directories they still get re-populated with the Web_App_*.dll and the pdb file. the timestamp is correct and both pdb file and dll file were created simultaniously.

What else could be going wrong?

Many thanks

Upvotes: 3

Views: 3176

Answers (1)

subsci
subsci

Reputation: 1740

This same issue plagued me today. I noticed a breakpoint not hit in Index.cshtml razor because source code is different than in App_Web*.dll. This occurred after I switched from IIS Express to local IIS.

To resolve, I did these things

  • Exit Visual Studio
  • Restart application pool and site in IIS;
  • exit IIS Express process and e.g. use "C:\Program Files (x86)\IIS Express\appcmd.exe"
  • clear C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
  • clear C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files
  • clear .\AppData\Local\Microsoft\WebsiteCache
  • clear .\AppData\Local\Temp\Temporary ASP.NET Files
  • Clean Rebuild

Upvotes: 3

Related Questions