且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

MVC 3 Visual Studio 2010 Razor 模型智能感知不起作用

更新时间:2023-02-03 11:15:05

我找到了 这篇 文章解决了我的问题.

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.