参数 targetplatformversion 不能为 null - visual studio 2015

parameter targetplatformversion cannot be null - visual studio 2015

我有 windows 10 台装有 visual studio 2015 的笔记本电脑。我正在尝试创建一个通用 Windows phone 应用程序的新项目。我总是得到错误参数 targetplatformVersion 不能为空。 以下是我机器的截图

我也尝试安装和重新安装 windows 10 sdk,但没有成功。

加载我可以看到 targetPlatformVersion 的现有项目也没有加载并抛出相同的错误。

知道如何找到这个问题吗?为什么我得到的参数 targetplatformversion 不能为空?

更新

在与 MS VS 团队的 Karan 进行详细讨论后,我们决定 运行 进行修复,结果成功了。

您是否尝试从以下位置下载 Windows 10 独立 SDK:

https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk

然后重新安装。

如果它不起作用,您可以使用安装程序修复您的 Visual studio,这个问题表明您的平台版本设置不正确。

如果这也不起作用,如果您已经从社区专业版等安装了更新 2,则应该查看您的 VS 版本。

希望对您有所帮助。

运行一个Visual Studio修复应该可以解决问题。


点击右上角的按钮将此问题报告为问题

然后按照说明进行操作here。确保提供跟踪和堆转储 - 不要将其视为可选。

完成此操作后请回复,我会确保对此进行查看。

转到卸载应用程序和 select visual studio 然后单击修复 问题就会解决 我在构建统一应用程序时遇到了同样的错误 当我修复视觉时,一切正常:)

我手动重新安装了 UWP SDK -> 没有成功

我通过 VS 安装程序重新安装了 UWP SDK -> 没有成功

我对 VS 2015 Community 进行了全面修复 -> 没有成功

然后我回滚了我所有项目的 Xamarin NuGet 包并从我的解决方案中删除了 UWP 项目,删除了本地内容,从源代码管理 (VS Team Services) 加载了最新版本,然后添加了新加载的项目我的解决方案。现在一切都恢复正常了。看起来 Xamarin NuGet 更新以某种方式损坏了我的 UWP 项目。 所以基本上我只是从源代码管理中加入了备份。源代码管理万岁!

编辑: 在我的解决方法之前,我向 VS 团队报告了这个问题。我刚刚得到一个答复,指出 NuGet 中存在一个错误,该错误将在未来得到修复。还提供了另一种解决方法。这是原始答案:

Thank you for your feedback! I'm sorry for the issue you're experiencing, as you described:

"I upgraded Xamarin and the Xamarin NuGet package in my package. I did not change the project file of the UWP project. Since then I can't open my UWP project anymore. I tried reinstalling the UWP SDK outside of VS, then I reinstalled them through the VS installer and then I did a complete repair of VS. All without success. Any help is greatly appreciated since I can't continue on my project with this problem. Best regards :) "

There was an issue with the Xamarin extension loading NuGet from a background thread. Xamarin updated their extension (grab the latest) to resolve this issue. We (The NuGet team) will release 3.5 next week, and that will make it work with the older versions of Xamarin or similarly misbehaving extensions. The issue is tracked by this issue on github, you can also try the following private build to unblock you until 3.5 is officially released

From Joel Verhagen on the thread linked above: Hey guys, thanks for all the reports of this issue. I am working on getting a fix into dev right now. In the mean time, could you try this private build out for Visual Studio 2015 (dev14)? https://dotnet.myget.org/F/nuget-vsix/vsix/NuGet.0d421874-a3b2-4f67-b53a-ecfce878063b-3.6.0.2363.vsix You will need to uninstall the old version of NuGet first before trying this one.

TL;DR:如果您因升级 Xamarin NuGet 包而遇到此问题,您可以尝试我的解决方法或使用 VS 2015 的专用 NuGet 构建或等到 NuGet 3.5 发布。

当我根据 this solution.

通过 Visual Studio 安装程序重新安装 UWP SDK 时,我已经解决了这个问题

引用:

我可以通过以下方式修复它。

  1. 转到 Add/Remove 程序并在修改模式下打开 Visual Studio 安装程序
  2. 删除 Windows 通用应用程序功能
  3. 重新安装Windows 通用应用程序功能。
  4. 现在打开Visual Studio>>新建项目>>空白应用程序(通用Windows) 主题:https://developercommunity.visualstudio.com/content/problem/280/cant-create-a-new-blank-uwp-project.html