Asp.net
清除 ASP.NET 臨時文件記憶體時遇到問題
我現在不知所措地掙扎了兩個多小時。
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 家庭高級版。
還有什麼我需要做的嗎?
嘗試,嘗試,但永遠不要說死。
修復。這是我的程式碼。在我的一種觀點中,我使用了舊名稱。我不確定為什麼編譯器沒有告訴我該視圖的模型聲明中的錯誤類型。
總之,浪費了3個小時。寶貴的經驗教訓:始終檢查您的程式碼。這主要是你自己的錯。
我有類似的問題,在全域調整項目命名空間將 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>