makerofthings7
makerofthings7

Reputation: 61473

Unable to debug Global.asax because the cache won't clear in .NET 4 x64 MVC3 on Windows 7

I'm trying to debug my Global.asax, and am doing all the "right" things such as

Finally in an effort of last resort, I deleted everything (all routes) in the Global.ASAX and the application continued to run fine.

I then deleted the /bin and /obj files, and ran the following batch file

iisreset /stop
rmdir /q /s "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files"
rmdir /q /s "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files"
rmdir /q /s "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files"
md "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files"
md "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files"
md "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files"
xcacls "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files" /E /G MYMACHINE\IIS_WPG:F /Q
xcacls "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files" /E /G MYMACHINE\IIS_WPG:F /Q
xcacls "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files" /E /G MYMACHINE\IIS_WPG:F /Q

rmdir /q /s "C:\WINDOWS\Microsoft.NET64\Framework\v1.1.4322\Temporary ASP.NET Files"
rmdir /q /s "C:\WINDOWS\Microsoft.NET64\Framework\v2.0.50727\Temporary ASP.NET Files"
rmdir /q /s "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files"
md "C:\WINDOWS\Microsoft.NET\Framework64\v1.1.4322\Temporary ASP.NET Files"
md "C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files"
md "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files"
xcacls "C:\WINDOWS\Microsoft.NET\Framework64\v1.1.4322\Temporary ASP.NET Files" /E /G MYMACHINE\IIS_WPG:F /Q
xcacls "C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files" /E /G MYMACHINE\IIS_WPG:F /Q
xcacls "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files" /E /G MYMACHINE\IIS_WPG:F /Q



iisreset /start
pause

And now I was finally able to break my application by having a screwed up Global.aspx file. I'm somewhat relieved that I know the system is "seeing" the updated file. Now I replaced the contents, saved it, I'm still unable to get my application to reload.

Now no matter what I do, the application does not load. It is remembering my mangled aspx file, even though I corrected the issue.

How to I force a reload of Global.Aspx?

enter image description here

Upvotes: 1

Views: 1394

Answers (3)

makerofthings7
makerofthings7

Reputation: 61473

The MVC website was set for the x86 platform, and that either confused the issue, or was the root cause.

Changing this to Any CPU seems to have corrected the problem

enter image description here

Upvotes: 1

Jared Peless
Jared Peless

Reputation: 1120

Do you have some of these DLLs in the GAC and they need refreshed?

Upvotes: 0

ZippyV
ZippyV

Reputation: 13038

You need to rebuild your code before you see the changes in global.asax. Creating a new build or rebuild will also recycle the application in Cassini or IIS.

Upvotes: 0

Related Questions