Haseeb Asif
Haseeb Asif

Reputation: 1786

parameter targetplatformversion cannot be null - visual studio 2015

I have windows 10 installed laptop with visual studio 2015 on it. I am trying to create a new project of universal Windows phone application. I always get the error Prameter targetplatformVersion cannot be null. Follwing are the screen shot of my machine

VS 2015 Error

I have tried installation and re-installing the windows 10 sdk as well but no luck.

Loading an existing project where I can see targetPlatformVersion already is also not loading and throwing same error.

Any idea how I can track down this issue that Why do I get parameter targetplatformversion cannot be null?

Update

After doing detailed discussion with Karan from MS VS team we decided to run the repair and it worked.

Upvotes: 3

Views: 2025

Answers (5)

I have resolved this problem when I have reinstall UWP SDK via Visual Studio Installer according this solution.

Citation:

I was able to fix it by following.

  1. Go to Add/Remove programs and open Visual Studio installer in modify mode
  2. Remove Windows Universal App feature
  3. Reinstall Windows Universal App feature.
  4. Now open Visual Studio>>New Project>>Blank App(Universal Windows) Thread: https://developercommunity.visualstudio.com/content/problem/280/cant-create-a-new-blank-uwp-project.html

Upvotes: 0

user4344677
user4344677

Reputation:

I reinstalled the UWP SDKs manually -> no success

I reinstalled the UWP SDKs via VS Setup -> no success

I did a full repair of VS 2015 Community -> no success

Then I rolled back my Xamarin NuGet package for all my projects and removed the UWP project from my solution, deleted the local content, loaded the latest version from source control (VS Team Services) and then added the freshly loaded project to my solution. Now everything is back to normal. Looks like the Xamarin NuGet update somehow corrupted my UWP project. So basically I just threw in the backup from Source Control. Hooray for Source Control!

EDIT: Before my workaround I reported the problem to the VS team. I just got an answer stating that there is a bug in NuGet that will get fixed in the future. Another workaround is also available. Here is the original answer:

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: If you got into this issue as a result of upgrading the Xamarin NuGet package, you can try my workaround or use the private NuGet build for VS 2015 or wait until NuGet 3.5 comes out.

Upvotes: 1

Abd Alrahman
Abd Alrahman

Reputation: 1

Go To Uninstall application and select visual studio then click on Repair and the problem will be solved i had the same error while build a unity app and when i repaired visual every thing worked fine :)

Upvotes: 0

karann - MSFT
karann - MSFT

Reputation: 481

Running a Visual Studio repair should solve the problem.


Report this as a problem by clicking on the button on the top right enter image description here

Then follow the instructions here. Ensure you Provide a trace and heap dump - do not treat this as optional.

Reply back once you have done this and I will make sure this gets looked at.

Upvotes: 1

FoldFence
FoldFence

Reputation: 2802

Have you tried to download the Windows 10 standalone SDK from:

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

And reinstall it.

And if its not working you can repair your Visual studio with the installer, this problem is a sign that something in your platform version setting is not correct.

And if thats also not working, you should have a look on your VS version if you have installed the update 2 from your community professional etc. version.

Hope that helps.

Upvotes: 0

Related Questions