Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Your project is not referencing the "UAP,Version=v10.0.10240" framework

I am using Visual Studio Community Edition 2017 and trying to create a UWP application.

I get the following error

Your project is not referencing the "UAP,Version=v10.0.10240" framework. Add a reference to "UAP,Version=v10.0.10240" in the "frameworks" section of your project.json, and then re-run NuGet restore.

like image 942
Khandakhulu Avatar asked Aug 15 '17 14:08

Khandakhulu


6 Answers

I had the same issue on my build machine. What's weird is everything runs fine on my local machine.

I managed to fix this by going into the project properties for my UWP app, and changing the Target version to match the Min version.

The reason I believe this issue is happening is because when targeting a higher framework, on a Windows Server machine (the build agent) it doesn't restore all of the packages between your min and target version. It seems to build fine against the version you target.

By the way Ken, following the instructions given by the error don't fix the issue. Try not to be so rude. I came to this page looking for the same issue, and you are no help at all.

like image 84
Jeff Avatar answered Nov 11 '22 12:11

Jeff


I have the same issue, after I remove my bin and obj folder, I can build mine and see the errors gone.

like image 40
spspli Avatar answered Nov 11 '22 12:11

spspli


I recently ran across this same issue when updating the target framework. The issue turned out to be the Nuget Restore task in my VSTS Build definition needed to be updated to the latest version (2.*). Once I did that, the builds worked as expected.

like image 3
Rob C. Avatar answered Nov 11 '22 14:11

Rob C.


I agree with Jeff. Ken Not sure if you should be giving any answers with this kind of attitude.

The error message is misleading there is not project.json at least you cannot see it in the Visual Studio explorer.

I had the same issue and have min and target version set to the same number but it would not build.

The fix was to make sure in Nuget package manager setting to tick checkbox 'Allow Nuget to download missing packages' and the one below it as well and rebuild the project.

like image 2
IronHide Avatar answered Nov 11 '22 12:11

IronHide


This is a pretty weird mistake, but what worked for me :

1st Solution:
1 - Change your project target to "10.0.10586" (or up)
2 - Make a clean / nuget restore / rebuild
3 - Return the project target to the "10.0.10240"
4 - Make a clean / nuget restore / rebuild

Do not ask me why, but it worked :)

2nd Solution:
If you use a repository with Tortoise, try making a CLEANUP

like image 1
Cassius Avatar answered Nov 11 '22 14:11

Cassius


I had an old Backup folder in my project that contained a project.json. Looks like it might have been from an earlier upgrade. I deleted Backup and got a good build.

like image 1
Joe Mayo Avatar answered Nov 11 '22 14:11

Joe Mayo