【问题标题】:Trouble clearing the ASP.NET Temporary Files cache清除 ASP.NET 临时文件缓存时遇到问题
【发布时间】:2014-06-25 16:01:56
【问题描述】:

我已经挣扎了两个多小时了。

ASP.NET 临时文件缓存仍然有我的程序集的旧副本,因此我无法运行我的应用程序。

实际上,我已将我的一门课程的名称从 HomePage 更改为 HomePageViewModel。因此,当我现在运行我的应用程序时,无论我做什么,它仍然会从缓存中提取旧程序集,并报告:

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?)

我现在已经做了很多次了:

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

在项目属性中,我已将项目配置为在 IISExpress 而不是本地 IIS 中运行。

我运行的是 64 位 Windows 7 家庭高级版。

我还有什么需要做的吗?

【问题讨论】:

  • 当您尝试运行您的应用程序时遇到什么错误或异常?
  • @Khan 谢谢,我已经更新了问题以包含错误信息。

标签: asp.net asp.net-mvc iis-7.5 iis-express


【解决方案1】:

我有类似的问题,在全局调整项目命名空间将 WebApplication3 重命名为另一个名称后,执行整个解决方案搜索没有帮助,因为 .config 扩展名没有指定通配符。无论如何,遇到类似问题的人,请检查项目根目录和视图文件夹的 web.config 文件

  <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>

【讨论】:

    【解决方案2】:

    尝试,尝试,但永远不要说死。

    修复它。这是我的代码。在我的一种观点中,我使用了旧名称。我不确定为什么编译器没有在该视图的模型声明中告诉我错误的类型。

    无论如何,浪费了 3 个小时。宝贵的经验教训:始终检查您的代码。这主要是你自己的错。

    【讨论】:

      【解决方案3】:

      提醒一下,我遇到了同样的问题,结果证明我没有更新我的 .cshtml 文件的名称空间(并且构建您的项目不会将此标记为问题)。

      【讨论】:

      • 这很有趣。
      猜你喜欢
      • 2010-12-02
      • 1970-01-01
      • 2013-04-14
      • 1970-01-01
      • 2011-08-01
      • 2010-11-01
      • 1970-01-01
      • 2022-11-01
      • 1970-01-01
      相关资源
      最近更新 更多