You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NuGet errors when compiling on command line with UWP projects and PackageReferences #4515
NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe): msbuild
NuGet version (x.x.x.xxx): 4.0 (msbuild v 15.1.523.56541)
VS version (if appropriate): 26127.3
OS version (i.e. win10 v1607 (14393.321)): 14393.693
Worked before? If so, with which NuGet version: No
Detailed repro steps so we can see the same problem
I've switched my UWP project to use PackageReferences which now support UWP projects. However, I find that it loads fine and compiles as expected in VS. When I try to compile on command line, it fails with the following errors:
[path]\KeePassWin\KeePassWin.sln" (restore;build target) (1) ->
"[path]\KeePassWin\test\KeePassLib.Test\KeePassLib.Test.csproj" (default target) (3:5) ->
(ResolveNuGetPackageAssets target) ->
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\NuGet\15.0\Microsoft.NuGet.targets(19
7,5): error : The project.json is referencing the project [path]\KeePassWin\test\src\KeePass
Lib\KeePass.Models.csproj', but an output path was not specified on an item in the ProjectReferencesCreatingPackages pr
operty. [[path]\KeePassWin\test\KeePassLib.Test\KeePassLib.Test.csproj]
"[path]\KeePassWin\KeePassWin.sln" (restore;build target) (1) ->
"[path]\KeePassWin\src\KeePass.Win.Services\KeePass.Win.Services.csproj" (default target) (4:
5) ->
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\NuGet\15.0\Microsoft.NuGet.targets(19
7,5): error : Your project is not referencing the "UAP,Version=v10.0.10586" framework. Add a reference to "UAP,Version=
v10.0.10586" in the "frameworks" section of your project.json, and then re-run NuGet restore.
If I restore with msbuild /t:restore I see the same error in VS. If I clean my repo and build straight from VS, things restore fine and compile as expected.
@twsouthwick can you diff the project.assets.json files between the command line restore and the Visual Studio output from restore? Is there any difference?
@twsouthwick try right clicking on the solution and selecting Restore NuGet Packages. Also make sure you have automatic package restore enabled under the Visual Studio NuGet options.
Ok - that seemed to work once I selected automatc package restore enabled; if that was disabled and I right click on the solution and select Restore NuGet packages, it does not work.
You'll notice that there is no change to KeePassWin (which is the UWP app and cannot be compiled for Any CPU. When I try msbuild /t:restore /p:Platform=x86 I get the following error:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Internal\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targe
ts(97,5): error : Sequence contains more than one matching element [(path)\KeePass
Win.sln]
What is status of this issue? It's almost August 2017 and I just hit this issue when building our UWP app in PowerShell:. We use PackageReferences and use TargetVersion 15063 and MinVersion 14393.
msbuild version '15.1.1012.6693', NuGet Version: 4.0.0.2283
Update, it's failing with NuGet 4.0.0 but working with 4.1.0.
Activity
emgarten commentedon Feb 6, 2017
@twsouthwick does it make a difference if you restore with Visual Studio vs the command line?
twsouthwick commentedon Feb 6, 2017
If I restore with
msbuild /t:restoreI see the same error in VS. If I clean my repo and build straight from VS, things restore fine and compile as expected.emgarten commentedon Feb 6, 2017
@twsouthwick can you diff the project.assets.json files between the command line restore and the Visual Studio output from restore? Is there any difference?
twsouthwick commentedon Feb 7, 2017
Hmmm... I'm now getting a different error. I just upgraded to 26205 d15rel and am seeing the following:
emgarten commentedon Feb 7, 2017
@twsouthwick try right clicking on the solution and selecting Restore NuGet Packages. Also make sure you have automatic package restore enabled under the Visual Studio NuGet options.
twsouthwick commentedon Feb 7, 2017
Ok - that seemed to work once I selected automatc package restore enabled; if that was disabled and I right click on the solution and select Restore NuGet packages, it does not work.
I've created a repo here that has the project.assets.json files: https://github.com/twsouthwick/NugetRestoreUwp. The first commit is adding the files from VS, the second commit is when I just restore from the commandline. It seems like it has different versions of the UWP SDK, but the order also seems off, so I'm not sure what's important there.
You'll notice that there is no change to KeePassWin (which is the UWP app and cannot be compiled for Any CPU. When I try
msbuild /t:restore /p:Platform=x86I get the following error:emgarten commentedon Feb 7, 2017
I tried this on VS 15.0.0-RC4+26205.0.d15rel and was unable to repro it using the develop branch.
Restore and build from the command line showed no errors. Restore and build in VS were also without errors.
msbuild /t:restore /p:Platform=x86does cause an error for me, it looks that is the same issue as #4316twsouthwick commentedon Feb 7, 2017
Which command are you using that works? I'm running
msbuild /t:restore;buildThat linked issue is one I filed earlier for a different project - hadn't realized they were similar :)
emgarten commentedon Feb 7, 2017
I'm able to repro it now. It isn't clear what the build task is expecting there.
To get the repro on the command line a clean is needed before building. On a rebuild it showed up.
rrelyea commentedon Feb 13, 2017
@emgarten - thoughts on this?
emgarten commentedon Feb 13, 2017
@rrelyea this issue is similar to #4532 which @zhili1208 was investigating. There are no .xproj files in this solution however.
martinsuchan commentedon Jul 31, 2017
What is status of this issue? It's almost August 2017 and I just hit this issue when building our UWP app in PowerShell:. We use PackageReferences and use TargetVersion 15063 and MinVersion 14393.
msbuild version '15.1.1012.6693', NuGet Version: 4.0.0.2283
Update, it's failing with NuGet 4.0.0 but working with 4.1.0.
emgarten commentedon Jul 31, 2017
Thanks for the update @martinsuchan, it looks like this can be closed as it was fixed with #4532 in 4.1.0
barishamil commentedon Aug 23, 2017
Having this problem after updating to creators edition then reverting changes via version control