问题描述
自从我为 VS 11 更新了我的项目以来,我无法让我的 @Model 智能感知在 Visual Studio 的任一版本(2010 或 11)中工作.我尝试恢复 .csproj 文件以删除 VS 11 引用,但无济于事.其他 MVC 3 Razor 项目运行良好.有人经历过吗?
Ever since I updated my projects for VS 11 I can't get my @Model intellisense to work in either version of Visual Studio (2010 or 11). I've tried reverting the .csproj file to remove the VS 11 references, but to no avail. Other MVC 3 Razor project are working just fine. Anyone experience this?
推荐答案
我找到了 这篇 文章解决了我的问题.
I found this article that addressed my issue.
似乎是安装 VS 11 和一些工具更新的某种组合导致了这个问题.我很幸运并设法收到以下错误消息:
It seems that some combination of installing VS 11 and some tool updates caused this issue. I got luck and managed to get the following error message:
The type System.Web.Mvc.ModelClientValidationRule exists in both c:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v2.O\Assemblies\System.Web.WebPages.dll and c:\Program
Files (6)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll
在进行了一些挖掘之后,我最终卸载了Microsoft ASP.NET Web Pages 2 - Visual Studio 2010 Tools",这导致一切正常.当然,卸载Microsoft ASP.NET Web Pages - Visual Studio 2010 Tools"可能是一个更好的主意,但目前正在运行.
After doing some digging I wound up uninstalling "Microsoft ASP.NET Web Pages 2 - Visual Studio 2010 Tools", which resulted in everything working. Granted it may have been a better idea to uninstall "Microsoft ASP.NET Web Pages - Visual Studio 2010 Tools" instead, but this is working at the moment.
我发现 Internet 上完全缺乏有关此类问题的信息,因此我将其放在这里以供后人使用.
I found a complete lack of information on the Internet about this type of issue, so I'm putting it here for posterity.
这篇关于MVC 3 Visual Studio 2010 Razor 模型智能感知不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!