简体   繁体   English

在VS2015中创建了一个新的MVC项目,并且Intellisense在Razor视图中产生了错误

[英]Created A New MVC Project In VS2015 And Intellisense Produces Error In Razor View

I just created a new web application (MVC 5.2.3) in Visual Studio 2015, and I regularly get errors like this on the HtmlHelpers: 我刚刚在Visual Studio 2015中创建了一个新的Web应用程序(MVC 5.2.3),并且经常在HtmlHelpers上收到类似这样的错误:

在此处输入图片说明

I'm using .NET 4.6 (the default project was set to 4.5.2 originally, however I still had this issue with that default setting). 我正在使用.NET 4.6(默认项目最初设置为4.5.2,但是该默认设置仍然存在此问题)。 I've looked at a bunch of similar questions on this site, and yet I haven't found a solution that consistently works. 我在这个网站上看过很多类似的问题,但是我还没有找到一个始终如一的解决方案。 Any advice? 有什么建议吗?

This sounds like a corrupted MEF cache to me. 这听起来像是我的MEF缓存已损坏。 Different user, different MEF cache. 不同的用户,不同的MEF缓存。
The PM of Razor Editing, Mads Kristensen, wrote an extension to make clearing the MEF cache simple. Razor Editing的项目经理Mads Kristensen编写了扩展程序,以使清除MEF缓存变得简单。 Try this: Clear MEF Component Cache . 尝试以下操作: 清除MEF组件缓存
You'll just have to restart VS after clearing; 您只需要在清除后重新启动VS即可; rebuilding the cache takes seconds, not minutes. 重建缓存需要几秒钟,而不是几分钟。

Please let us know if this solves the problem for you. 如果这可以为​​您解决问题,请告诉我们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM