Hi,
when you include the SourceLink NuGet Package for VSTS.Git for Reference see here
https://github.com/dotnet/sourcelink in a SDK Project.
Quote:
<PackageReference Include="Microsoft.SourceLink.Vsts.Git" Version="1.0.0-beta-62925-02">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
the i get the following error in build (local and grid note, v3.17)
Btw. i'm not able to copy and paste the error message from the NCrunch Test Window.
Quote:
NCrunch: This project was built on server 'whatever
..\..\..\..\Users\DerAl\.nuget\packages\microsoft.build.task.git\1.0.0-beta=62925-02\build\Microsoft.Build.Task.Git.targets (20, 5): Unable to locate repository containing repository 'C:\NCrunch Grid Node\5668\327\src\Myproject.Name.Foo
This makes seens, because the build taks try to guess the git repository uri at build time, but there is of cource none visible for NCrunch.
So i tried to obvious and added a condition to the package reference.
Quote:
<PackageReference Include="Microsoft.SourceLink.Vsts.Git" Version="1.0.0-beta-62925-02" Condition="'$(NCrunch)' != '1'">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
But this does not help, i packed this inside a seperate ItemGroup with the condition, but this also not work.
Now this can be a problem on the MSBuild Side, or on the NCrunch side. Because of the highly optimized custom build on the NCrunch Side, i assume that is NCrunch which is ignoring Conditions on PackageReferences.
if not, then i file a bug on dotnet repository.