不知道怎么可能,但是我得到了这个错误信息:
那是在我完成之后发生的:
Warning 3 The primary reference "System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the framework assembly "System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" or retarget your application to a framework version which contains "System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089".
我敢打赌,解决方案是平庸的,但一定是在星期五的下午。
顺便说一句,我还安装了VS 2008,MVC 1,MVC 2和所有.NET Framework版本并可以正常使用。
更新1:
实际上,针对.NET 4的 MVC 2 项目存在完全相同的问题。
更新2:我觉得这有点相关-我确实很想念
C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0
文件夹中的 System.Data.Linq.dll (尽管存在 System.Data.Linq.xml )我重新安装了.NET 4框架,但是并没有解决问题。
最佳答案
只是在使用其他dll时遇到了类似的问题(无法添加引用)。清除最近添加的引用列表确实有帮助。
关于.net - MVC 3 "is incompatible with .NET Framework 4",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6307944/