dotnet / dotnet/NuGet.BuildTasks

ResolveNuGetPackageAssets will throw NullReferenceException when PackageVersion is not set

Open
#171 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
47
Forks
65
PR merge metrics
No merged PRs in 30d

Description

_Moved from https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1896623_

> I have a legacy .csproj solution that uses Central Package Management. If I add a to a project and exclude the Version property (as expected for CPM) but forget to define the Version in Directory.Packages.props for that package ID, I get a null reference exception:
>
>
> 20>C:\Program Files\Microsoft Visual Studio\2022\IntPreview\MSBuild\Microsoft\NuGet\17.0\Microsoft.NuGet.targets(198,5): error : Object reference not set to an instance of an object.

`NU1010: The PackageReference items RuntimeContracts do not have corresponding PackageVersion.`

Related: https://github.com/dotnet/NuGet.BuildTasks/issues/77

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.