Home: Microsoft.NuGet.targets refers to project.json for PackageReference projects

Created on 9 Mar 2017  路  6Comments  路  Source: NuGet/Home

Microsoft.NuGet.targets incorrectly refers to project.json in errors/warnings for PackageReference projects. All of these should be replaced to either say the correct file, or use a generic term for this.

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

Most helpful comment

Opened corresponding bug for Project system team who handle NuGet.BuildTasks - internal bug# 539617

All 6 comments

Any news on this? Seems to be a bit of a blocker for us

@wayne-o the fix for this issue is to update the error message only. You likely want to open a new issue for the problem you are hitting.

I had the same issue with old cs projects. The problem was in environment variable MSBUILDDEFAULTTOOLSVERSION set to 14. I removed it and the problem solved.

@nkolev92 this impacts PC -> PR

Hi.
I understand that this issue is about correcting message only. But could you tell what it actually means?
I'm having this error in my solution with mixed old and new style csproj (but all of them use PackageReference for nuget ref).

"D:\Work\...\Dsl.csproj" (default target) (1) ->
(ResolveNuGetPackageAssets target) ->
  Z:\Prog\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\NuGet\15.0\Microsoft.NuGet.targets(184,5): error : Your proj ect.json doesn't have a runtimes section. You should add '"runtimes": { "win": { } }' to your project.json and then re-run NuGet  restore. [D:\...\Dsl.csproj]

(edit) here's the whole story - https://stackoverflow.com/questions/46939387

Opened corresponding bug for Project system team who handle NuGet.BuildTasks - internal bug# 539617

Was this page helpful?
0 / 5 - 0 ratings