简体   繁体   中英

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. I'm trying to add this dll Microsoft.AspNet.Mvc 5.2.9 but I'm getting this below error. 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)

I'm expecting System.Web.Mvc should be added to my project.

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. That way you are sure it has correct boilerplate code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM