GitVersion: 4.0.1-beta1-53: Fails to find the LibGit2Sharp.

This compiled before lunch 😛

> dotnet build
Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 24,17 ms for C:\Src\Project.csproj.
[NuGet Minimal]: Restoring packages for C:\Users\MichaelBisbjerg\.nuget\packages\gitversiontask\4.0.1-beta1-53\build\functionality\GitVersionBuild.targets...
[NuGet Minimal]: Restoring packages for C:\Users\MichaelBisbjerg\.nuget\packages\gitversiontask\4.0.1-beta1-53\build\functionality\GitVersionBuild.targets...
MSBUILD : warning : WARN [12/13/18 13:00:50:51] Could not determine assembly version: System.IO.FileNotFoundException: Could not load file or assembly 'LibGit2Sharp, Version=0.26.0.0, Culture=neutral, PublicKeyToken=7cbde695407f0333'. The system cannot find the file specified. [C:\Src\Project.csproj]
MSBUILD : warning : File name: 'LibGit2Sharp, Version=0.26.0.0, Culture=neutral, PublicKeyToken=7cbde695407f0333' ---> System.IO.FileNotFoundException: Could not load the specified file. [C:\Src\Project.csproj]
MSBUILD : warning : File name: 'LibGit2Sharp' [C:\Src\Project.csproj]
MSBUILD : warning :    at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(AssemblyName assemblyName) [C:\Src\Project.csproj]
MSBUILD : warning :    at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingResolvingEvent(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName) [C:\Src\Project.csproj]
MSBUILD : warning :    at GitVersion.GitPreparer.GetDotGitDirectory() [C:\Src\Project.csproj]
MSBUILD : warning :    at GitVersion.ExecuteCore.ExecuteGitVersion(String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId, Config overrideConfig, Boolean noCache) in C:\projects\gitversion\src\GitVersionCore\ExecuteCore.cs:line 33 [C:\Src\Project.csproj]
MSBUILD : warning :    at GitVersion.ExecuteCore.TryGetVersion(String directory, VersionVariables& versionVariables, Boolean noFetch, Authentication authentication) in C:\projects\gitversion\src\GitVersionCore\ExecuteCore.cs:line 82 [C:\Src\Project.csproj]
MSBUILD : warning :  [C:\Src\Project.csproj]
MSBUILD : warning :  [C:\Src\Project.csproj]
MSBUILD : warning : WARN [12/13/18 13:00:50:54] Could not determine assembly version: System.IO.FileNotFoundException: Could not load file or assembly 'LibGit2Sharp, Version=0.26.0.0, Culture=neutral, PublicKeyToken=7cbde695407f0333'. The system cannot find the file specified. [C:\Src\Project.csproj]
MSBUILD : warning : File name: 'LibGit2Sharp, Version=0.26.0.0, Culture=neutral, PublicKeyToken=7cbde695407f0333' ---> System.IO.FileNotFoundException: Could not load the specified file. [C:\Src\Project.csproj]
MSBUILD : warning : File name: 'LibGit2Sharp' [C:\Src\Project.csproj]
MSBUILD : warning :    at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(AssemblyName assemblyName) [C:\Src\Project.csproj]
MSBUILD : warning :    at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingResolvingEvent(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName) [C:\Src\Project.csproj]
MSBUILD : warning :    at GitVersion.GitPreparer.GetDotGitDirectory() [C:\Src\Project.csproj]
MSBUILD : warning :    at GitVersion.ExecuteCore.ExecuteGitVersion(String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId, Config overrideConfig, Boolean noCache) in C:\projects\gitversion\src\GitVersionCore\ExecuteCore.cs:line 33 [C:\Src\Project.csproj]
MSBUILD : warning :    at GitVersion.ExecuteCore.TryGetVersion(String directory, VersionVariables& versionVariables, Boolean noFetch, Authentication authentication) in C:\projects\gitversion\src\GitVersionCore\ExecuteCore.cs:line 82 [C:\Src\Project.csproj]
MSBUILD : warning :  [C:\Src\Project.csproj]
MSBUILD : warning :  [C:\Src\Project.csproj]
MSBUILD : warning : WARN [12/13/18 13:00:50:57] Could not determine assembly version: System.IO.FileNotFoundException: Could not load file or assembly 'LibGit2Sharp, Version=0.26.0.0, Culture=neutral, PublicKeyToken=7cbde695407f0333'. The system cannot find the file specified. [C:\Src\Project.csproj]
MSBUILD : warning : File name: 'LibGit2Sharp, Version=0.26.0.0, Culture=neutral, PublicKeyToken=7cbde695407f0333' ---> System.IO.FileNotFoundException: Could not load the specified file. [C:\Src\Project.csproj]
MSBUILD : warning : File name: 'LibGit2Sharp' [C:\Src\Project.csproj]
MSBUILD : warning :    at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(AssemblyName assemblyName) [C:\Src\Project.csproj]
MSBUILD : warning :    at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingResolvingEvent(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName) [C:\Src\Project.csproj]
MSBUILD : warning :    at GitVersion.GitPreparer.GetDotGitDirectory() [C:\Src\Project.csproj]
MSBUILD : warning :    at GitVersion.ExecuteCore.ExecuteGitVersion(String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId, Config overrideConfig, Boolean noCache) in C:\projects\gitversion\src\GitVersionCore\ExecuteCore.cs:line 33 [C:\Src\Project.csproj]
MSBUILD : warning :    at GitVersion.ExecuteCore.TryGetVersion(String directory, VersionVariables& versionVariables, Boolean noFetch, Authentication authentication) in C:\projects\gitversion\src\GitVersionCore\ExecuteCore.cs:line 82 [C:\Src\Project.csproj]
MSBUILD : warning :  [C:\Src\Project.csproj]
MSBUILD : warning :  [C:\Src\Project.csproj]
C:\Program Files\dotnet\sdk\2.1.500\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.GenerateAssemblyInfo.targets(161,5): error MSB4044: The "GetAssemblyVersion" task was not given a value for the required parameter "NuGetVersion". [C:\Src\Project.csproj]

Build FAILED.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 3
  • Comments: 26 (15 by maintainers)

Commits related to this issue

Most upvoted comments

@arturcic it was the was I tried for I actually switch to the normal one with 5.0 and it works.

Sounds good. I’ll stick with beta1-59 and the libgit2-dev install for the time-being.

So it is basically GitVersion on netstandard 2.0 using LibGit2Sharp version netstandard 1.3 I guess

I now get this. While it’s just a Warning, the build fails for completely different reasons - Jetbrains attributes are missing… It still does build in 4.0.1-beta1-51, fails as before in -53 , and fails like below in -55.

MSBUILD : warning : WARN [12/22/18 4:11:12:00] Could not determine assembly version: System.Runtime.InteropServices.MarshalDirectiveException: StrictFilePathMarshaler must be used on a FilePath. [C:\Project\Project.csproj]
MSBUILD : warning :    at LibGit2Sharp.Core.StrictFilePathMarshaler.MarshalManagedToNative(Object managedObj) in C:\projects\libgit2sharp\LibGit2Sharp\Core\FilePathMarshaler.cs:line 71 [C:\Project\Project.csproj]
MSBUILD : warning :    at System.StubHelpers.MngdRefCustomMarshaler.ConvertContentsToNative(IntPtr pMarshalState, Object& pManagedHome, IntPtr pNativeHome) [C:\Project\Project.csproj]
MSBUILD : warning :    at LibGit2Sharp.Core.NativeMethods.git_repository_discover(GitBuf buf, FilePath start_path, Boolean across_fs, FilePath ceiling_dirs) [C:\Project\Project.csproj]
MSBUILD : warning :    at LibGit2Sharp.Core.Proxy.ConvertPath(Func`2 pathRetriever) in C:\projects\libgit2sharp\LibGit2Sharp\Core\Proxy.cs:line 3553 [C:\Project\Project.csproj]
MSBUILD : warning :    at LibGit2Sharp.Repository.Discover(String startingPath) in C:\projects\libgit2sharp\LibGit2Sharp\Repository.cs:line 645 [C:\Project\Project.csproj]
MSBUILD : warning :    at GitVersion.GitPreparer.GetDotGitDirectory() in C:\projects\gitversion\src\GitVersionCore\GitPreparer.cs:line 163 [C:\Project\Project.csproj]
MSBUILD : warning :    at GitVersion.ExecuteCore.ExecuteGitVersion(String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId, Config overrideConfig, Boolean noCache) in C:\projects\gitversion\src\GitVersionCore\ExecuteCore.cs:line 33 [C:\Project\Project.csproj]
MSBUILD : warning :    at GitVersion.ExecuteCore.TryGetVersion(String directory, VersionVariables& versionVariables, Boolean noFetch, Authentication authentication) in C:\projects\gitversion\src\GitVersionCore\ExecuteCore.cs:line 82 [C:\Project\Project.csproj]

Thanks, yes that’s a good start, I’ll try to find some time and check why it’s not adding to the netstandard2.0

Unfortunately I’m under a pretty big time crunch at work and don’t have the time to look at other stuff. I also don’t really use or understand how GitVersionTask works so I don’t have much to go on. Just based on the error message though I followed a hunch and downloaded the gitversiontask-4.0.1-beta1-53.nupkg file and decompressed it to look at the files. The build/net461 directory contains LibGit2Sharp.dll and the lib folder with the native bits but the build/netstandard2.0 folder does not. So I assume it’s just a packaging issue. I tried to glance through the project and build scripts and couldn’t immediately understand how that package is produced to include the files directly rather than as nuget references like in the other projects that produce nuget packages.

That’s all the time I can spend on it for now but hopefully it points someone more knowledgeable than I in the right direction.