gpt4 book ai didi

.net - MVC 3 "is incompatible with .NET Framework 4"

转载 作者:行者123 更新时间:2023-12-04 04:27:14 24 4
gpt4 key购买 nike

不知道怎么可能,但是我得到了这个错误信息:

那是在我完成之后发生的:

  • 已安装.NET 4和Visual Studio 2010 Professional
  • 使用WPI + NuGet +一些时髦的时髦库软件包
  • 安装了VS 2010 SP1软件包
  • 使用WPI
  • 安装了ASP.NET MVC 3(包括2011年4月的工具更新)程序包
  • 创建了一个新的带有Razor支持的空MVC 3 C#Web应用程序
  • 无法构建它,因为出现此错误: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".
  • 检查项目是否以.NET 4为目标。
  • 删除了对System.Web.Mvc的引用,并尝试再次添加它(版本3.0),并得到了上述错误消息(上面的截图)
  • 尝试重新安装了一些组件,以随机顺序执行了一些先前的步骤,在我的计算机上撒了一些原始的鸡血,然后一次又一次地重新启动Windows,所有这些都无济于事。

  • 我敢打赌,解决方案是平庸的,但一定是在星期五的下午。

    顺便说一句,我还安装了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/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com