Asp.net-Mvc

建構錯誤 AppDataLocalTempTFSTemp

  • August 17, 2017

當我建構我的 ASP.NET MVC 應用程序(VS2013,.net 4.5.1)時,我遇到了這些錯誤。

我通過刪除完整的標記來重構“login.cshtml”並再次這樣做。現在我得到以下建構錯誤(紅色錯誤)。但是建構狀態是“建構成功”並且應用程序工作正常。

所以這是特定於我的本地機器的。

Error   21  The name 'RenderBody' does not exist in the current context c:\Users\....\AppData\Local\Temp\TFSTemp\vctmp6480_135776.cshtml    61  34  Miscellaneous Files

Error   20  The name 'Scripts' does not exist in the current context    c:\Users\...\AppData\Local\Temp\TFSTemp\vctmp6480_135776.cshtml 34  6   Miscellaneous Files

Error   17  The name 'Styles' does not exist in the current context c:\Users\....\AppData\Local\Temp\TFSTemp\vctmp6480_135776.cshtml    20  6   Miscellaneous Files

我已經清理了c:\Users\....\AppData\Local\Temp\TFSTemp文件夾。我仍然得到這個問題。有任何想法嗎?

這對我有用:

  1. “清潔”解決方案
  2. 關閉 Visual Studio
  3. 刪除整個.../TFSTemp文件夾
  4. 遞歸獲取最新資源
  5. 重新打開解決方案並重建所有。

引用自:https://stackoverflow.com/questions/20834271