Water Cooler v2
Water Cooler v2

Reputation: 33880

Trouble clearing the ASP.NET Temporary Files cache

I am at my wits' end struggling for over two hours now.

The ASP.NET Temporary Files cache still has an old copy of my assemblies and as a result, I am not able to run my app.

I'd actually changed the name of one of my classes from HomePage to HomePageViewModel. So, when I run my app now, it still picks up the old assemblies from the cache no matter what I do, and it reports:

2014-06-25 21:17:30,840 [13] ERROR ExceptionLogger 
Error: System.Web.HttpCompileException (0x80004005): 
c:\Users\computer\AppData\Local\Temp\Temporary ASP.NET 
Files\root\0ee70bca\3973e798\App_Web_index.cshtml.a8d08dba.na12ukjv.0.cs(30): 
error CS0234: The type or namespace name 'HomePage' does 
not exist in the namespace 'MyProduct.Web.Presentation.
ViewModels' (are you missing an assembly reference?)

I have done the following many times now:

a) Closed Visual Studio

b) Stopped IIS using the Internet Services 
Manager (inetmgr.exe) tool.

c) Stopped the World Wide Publishing Service from 
the Services applet in the Control Panel

d) Deleted all files from the %tmp%\Temporary 
ASP.NET Files folder

e) Deleted all files from the %windir%\temp folder

f) Deleted all files from the %windir%\Microsoft.NET\
Framework\v4.0.30319\Temporary ASP.NET Files folder

g) Deleted all files from the %windir%\Microsoft.NET\
Framework64\v4.0.30319\Temporary ASP.NET Files folder

h) Started the WWW service (the one stopped in step c) 
and IIS from inetmgr.exe.

i) Opened and started debugging my ASP.NET MVC Web 
application project

In the project properties, I have configured the project to run in IISExpress instead of the local IIS.

I am running 64-bit Windows 7 Home Premium.

Is there something else I need to do?

Upvotes: 10

Views: 12422

Answers (3)

Jay
Jay

Reputation: 1033

Just a heads up, I had the same issue, It turns out I had not updated the name spaces for my .cshtml files (and building your project does not flag this as an issue).

Upvotes: 1

mike123
mike123

Reputation: 1559

I had similar issue, after adjusting project namespace globally renaming WebApplication3 to another name, performing entire solution search didn't help because .config extension wasn't wildcard specified. Anyways anyone running into similar issue, check the web.config files both project root and views folder

  <system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
  <namespaces>
    <add namespace="System.Web.Mvc" />
    <add namespace="System.Web.Mvc.Ajax" />
    <add namespace="System.Web.Mvc.Html" />
    <add namespace="System.Web.Routing" />
    **<add namespace="WebApplication3" />**
  </namespaces>
</pages>

Upvotes: 14

Water Cooler v2
Water Cooler v2

Reputation: 33880

Try, try but never say die.

Fixed it. It was my code. I had the old name in one of my views. I am not sure why the compiler didn't tell me about the wrong type in the model declaration of that view.

Anyways, 3 hours wasted. Precious lesson learnt: always check your code. It's mostly your own fault.

Upvotes: 10

Related Questions