2
votes

I have a UWP library project, compiled to target Creators Update, and I am trying to publish it to nuget.

Using the command nuget package with nuget pack .csproj and I am getting this error:

nuget : The imported project "C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v15.0\Microsoft.Windows.UI.Xaml.CSharp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

I navigated to that directory and all I have is v14.0 and v12.0.

I have Windows 10 Creators Update and the latest Visual Studio 2017. What do I need to install those build files?

1
I'm having the same issue. Did you ever resolve this?John
I had to get the nuget executable and put it in the directory above the project and then I just used the path to that directory. I didn't use any automated tools and since this works and was simple enough I just keep doing it that way. So yes I've been able to do it but no I am not using the automated tools etc.Michael Puckett II
I found that the version of the nuget.exe cli tool was out of date. So I downloaded the latest version and put it in the VS2017 tools folder and it fixed my issue. Seems that although nuget claim VS2017 will always be up to date with the latest version of nuget tools, it not happening for the CLI exe.John

1 Answers

-1
votes

Try this

nuget pack foo.csproj -MSBuildVersion 14