Nerdbank.GitVersioning: GetBuildVersion task fails for full Framework builds
Repro steps
- Create a new Console Application (.NET Framework)
- Install package Nerdbank.GitVersionong (either using packages.config or <PackageReference/>)
- Build the project
Error:
System.IO.FileNotFoundException: Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
File name: 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
at Nerdbank.GitVersioning.VersionOracle.Create(String projectDirectory, String gitRepoDirectory, ICloudBuild cloudBuild, Nullable`1 overrideBuildNumberOffset, String projectPathRelativeToGitRepoRoot)
at Nerdbank.GitVersioning.Tasks.GetBuildVersion.ExecuteInner()
at MSBuildExtensionTask.ContextAwareTask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
I tested this using both Visual Studio 2015 and 2017 (15.8.1) on both Windows 7 and Windows 10 machines.
I do not know if it is relevant, but the Console Application is targeting .NET 4.6.1
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 44 (1 by maintainers)
Commits related to this issue
- disable VS2015 build until https://github.com/AArnott/Nerdbank.GitVersioning/issues/228 is fixed — committed to SpecFlowOSS/SpecFlow.VisualStudio by deleted user 6 years ago
- disable VS2015 build until https://github.com/AArnott/Nerdbank.GitVersioning/issues/228 is fixed — committed to littlegenius666/SpecFlow.VisualStudio by deleted user 6 years ago
- Bump xunit from 2.5.3 to 2.6.1 (#228) Bumps [xunit](https://github.com/xunit/xunit) from 2.5.3 to 2.6.1. - [Commits](https://github.com/xunit/xunit/compare/2.5.3...2.6.1) --- updated-dependencie... — committed to dotnet/Nerdbank.GitVersioning by dependabot[bot] 8 months ago
@AArnott I’ve been out of town, so I haven’t had a chance to take a look at it this yet. At this point it might be Tuesday before I’ll be able to. Wanted to let you know that it’s on my radar.
I’ll be so happy once we get rid of all the problematic native dependencies and fix this once and for all!
FYI LibGit2Sharp 0.26.0-preview-0062 is up on nuget.org and it includes a separate
ubuntu.18.04-x64
binary.I played around a little more and installing the .NET 4.7.1 Targeting pack solves the issue as this seems to put
netstandard.dll
into the GACAlso there is a open PR for LibGit2Sharp that adds a net461 target (https://github.com/libgit2/libgit2sharp/pull/1606), I guess updating the referenced version of LibGit2Sharp once this lands on NuGet might solve the issue too.
Based on the RID graph, Ubuntu 16 would end up using the
linux-x64
RID, as it was previously doing.Take a look at https://github.com/dotnet/corefx/blob/master/pkg/Microsoft.NETCore.Platforms/runtime.compatibility.json
For a given RID, that will show you the fallback options if the exact RID doesn’t exist in the package.
For example, here is
ubuntu.16.04-x64
:@AArnott You can try installing both
libcurl3
andlibssl1.0.0
and see if that works. I think having those installed would get the existinglinux-x64
binary working, until there’s a specific 18.04 lib that is built againstlibcurl4
andlibssl1.1
.@bording: can you help decipher this log, which we got when updating to the latest libgit2sharp 0.26.0-preview-0054 release? ld_debug.zip
❗️ Workaround: Use version 2.1.84 (which uses an older libgit2sharp dependency that didn’t have the bug).
libgit2/libgit2sharp#1606 is now merged, so framework moniker should be in next release.