Must use PackageReference 解决办法

Must use PackageReference
这是因为 .net framework的项目 在nuget时,引用到了 .net core 下的包。
解决办法,把之前引用的相关包全部在nuget上删除,然后,在工具-选项-NuGet 包管理器里找到默认包管理格式:选择PackageReference。这是如果引用少的情况可以这样,如果引用多了,可以这样操作。
Perform any one of the following NuGet actions:
  • Open the Package Manager UI - Right-click on References and select Manage NuGet Packages...
  • Open the Package Manager Console - From Tools > NuGet Package Manager, select Package Manager Console
  • Run NuGet restore - Right-click on the solution node in the Solution Explorer and select Restore NuGet Packages
  • Build the project which also triggers NuGet restore
You should now be able to see the migration option. Note that this option is not supported and will not show up for ASP.NET and C++ project types.
工具-选项-NuGet 包管理器里找到默认包管理格式:选择PackageReference
然后右击解决方案,点击 【还原 Nuget包】
这个解决办法只对visual studio 2017以上的才行,2017以下的没这个选项
更深入了解还得官网:
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章