[英]Package 'Microsoft.AspNet.Mvc 5.2.9 ' was restored using .NetFramework, Version=v4.6.1, instead of the project target framework
I have an ASP.NET Core 6.0 MVC project.我有一个 ASP.NET Core 6.0 MVC 项目。 I'm trying to add this dll
Microsoft.AspNet.Mvc 5.2.9
but I'm getting this below error.我正在尝试添加此 dll
Microsoft.AspNet.Mvc 5.2.9
但出现以下错误。 Please refer to this screenshot:请参考这个截图:
enter image description here在此处输入图像描述
We are migrating from ASP.NET MVC 5 to ASP.NET Core 6.0 in Visual Studio 2022 (version 17.4.2)我们正在 Visual Studio 2022(版本 17.4.2)中从 ASP.NET MVC 5 迁移到 ASP.NET Core 6.0
I'm expecting System.Web.Mvc
should be added to my project.我期待
System.Web.Mvc
应该添加到我的项目中。
Thanks Regards Krishna谢谢 问候 克里希纳
You can generate some dummy ASP.NET MVC Core 6 project with VS2022, and take from its.csproj file, dependencies on MVC NuGet packages.您可以使用 VS2022 生成一些虚拟 ASP.NET MVC Core 6 项目,并从其 .csproj 文件中获取对 MVC NuGet 包的依赖项。 That way you are sure it has correct boilerplate code.
这样你就可以确定它有正确的样板代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.