AspNetZero - .NET Core 2.0 MVC Version - Error on adding new controller

断了今生、忘了曾经 提交于 2019-12-25 01:47:20

问题


After about 6 months, I returned to work on my AspNetZero solution based on .NET Core 2.0. I have the original downloaded version and the modified version as separate GIT repositories. In both versions/repositories when I try to add a new MVC controller, I keep getting the below error message.

On my PC I have all of the .NET Core SDKs installed from 1.0 right up to 2.1.302. I have other projects that I am working on, where I'm using .NET Core 2.1.

I even created a brand new .NET Core 2.0 project in VS2017 and I am able to scaffold a new MVC controller without any errors. This issue is only happening on the AspNetZero solution.

I have done many searches for a solution and none of the answers I found online have worked. I just added a global.json file into my solution folder and set the SDK to 2.0.0 and tried again, still does not work. I keep getting the same error!


回答1:


  1. Your NuGet packages may have been invalid according to your target framework. Check all your recent NuGet packages for .NET Core versions.
  2. Clear your NuGet cache as shown in the picture

Update: Delete all bin & obj folders.



来源:https://stackoverflow.com/questions/51697823/aspnetzero-net-core-2-0-mvc-version-error-on-adding-new-controller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!