UWP Windows-10 Cannot add Microsoft.NETCore.UniversalWindowsPlatform to my C# app

人走茶凉 提交于 2019-12-24 06:19:06

问题


I have a C# app targeting windows UWP. It was all working fine couple month's ago. When I opened it today, it cannot find this reference: Microsoft.NETCore.UniversalWindowsPlatform. I am unable to install this reference as well. Here are my project details & the steps I have followed:

My VS details:

  MS VS Professional 2015
  Version 14.0.25123.00 Update 2
  Microsoft .NET Framework
  Version 4.6.01038


When I try to install this reference: Referencs(right click)->Manage NuGet Packages, & then by selecting Microsoft.NETCore.UniversalWindowsPlatform, I get this error:

Could not install package 'Microsoft.NETCore.Platforms 1.0.0'. You are trying to install this package into a project that targets '.NETCore,Version=v5.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.


I have NuGet Package Manager for Visual Studio 2015 Version 3.4.3.855 installed.

Based on the suggestion available here Github MS UWP samples page I deleted project.json from my project, but that doesnt seem to help me. Unfortunately I do not see project.lock.json file in my project


回答1:


I had similar exception after copy solution folder to other machine. In project.lock.json in field "packageFolders" and "project" where my settings for previse machine, I have changed them and it resolve my issue



来源:https://stackoverflow.com/questions/37398916/uwp-windows-10-cannot-add-microsoft-netcore-universalwindowsplatform-to-my-c-sha

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