When a PackageReference is missing "Version", it fails gracefully with something like
warning NU1604: Project dependency xunit does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results.
When DotNetCliToolReference is missing "Version", it fails completely with an ArgumentNullException. This breaks our ability to use the /t:GenerateRestoreGraphFile target to example a repo's restore graph for issues.
Repro
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<DotNetCliToolReference Include="dotnet-xunit" />
</ItemGroup>
</Project>
dotnet restore
Result
C:\Users\namc\.dotnet\x64\sdk\2.0.0-preview3-006915\NuGet.targets(331,5): error MSB4018: The "GetRestoreDotnetCliToolsTask" task failed unexpectedly.\r [C:\tmp\tst\classlib1\tst.csproj]
System.ArgumentNullException: Value cannot be null.\r [C:\tmp\tst\classlib1\tst.csproj]
Parameter name: value\r [C:\tmp\tst\classlib1\tst.csproj]
at NuGet.Versioning.VersionRange.TryParse(String value, Boolean allowFloating, VersionRange& versionRange)\r [C:\tmp\tst\classlib1\tst.csproj]
at NuGet.Versioning.VersionRange.Parse(String value, Boolean allowFloating)\r [C:\tmp\tst\classlib1\tst.csproj]
at NuGet.Build.Tasks.GetRestoreDotnetCliToolsTask.Execute()\r [C:\tmp\tst\classlib1\tst.csproj]
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()\r [C:\tmp\tst\classlib1\tst.csproj]
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__25.MoveNext() [C:\tmp\tst\classlib1\tst.csproj]
Details
NuGet product used: dotnet.exe
dotnet.exe --version: 2.0.0-preview3-006915
When a PackageReference is missing "Version", it fails gracefully with something like
When DotNetCliToolReference is missing "Version", it fails completely with an ArgumentNullException. This breaks our ability to use the
/t:GenerateRestoreGraphFiletarget to example a repo's restore graph for issues.Repro
dotnet restoreResult
Details
NuGet product used: dotnet.exe
dotnet.exe --version: 2.0.0-preview3-006915