GitVersion Task 5.0.2 with .netcore 3

Created on 25 Sep 2019  路  12Comments  路  Source: GitTools/GitVersion

Any updates when GitVersion is supported with .netcore 3 SDK?

```Starting: GitVersion

Task : GitVersion Task
Description : Easy Semantic Versioning (http://semver.org) for projects using Git
Version : 5.0.2
Author : GitVersion Contributors

Help : See the documentation for help

C:\hostedtoolcache\windows\dotnet\dotnet.exe D:/a/_tasks/GitVersion_25b46667-d5a9-4665-97f7-e23de366ecdf/5.0.2/core/GitVersion.dll D:/a/1/s /output buildserver /nofetch
It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '2.1.0' was not found.

  • The following frameworks were found:
    3.0.0 at [C:\hostedtoolcache\windows\dotnet\shared\Microsoft.NETCore.App]

You can resolve the problem by installing the specified framework and/or SDK.

The .NET Core frameworks can be found at:

[error]Error: The process 'C:\hostedtoolcache\windows\dotnet\dotnet.exe' failed with exit code 2147516566

```

Most helpful comment

We're working on that. Hopefully I can find some spare time to target .net core 3.0 as well

All 12 comments

We're working on that. Hopefully I can find some spare time to target .net core 3.0 as well

1849

@ladeak can you try version 5.0.2-beta.1+95 when it gets indexed?

I can give it a try next week.

Trying to use GitVersion dotnet tool with .net core 3 sdk.

The 5.0.2-beta.1+95 throws a new exception:

Using Docker executor with image mcr.microsoft.com/dotnet/core/sdk:3.0 ...
Pulling docker image mcr.microsoft.com/dotnet/core/sdk:3.0 ...
Using docker image sha256:4422e7fb740c14af167b232a7b485d60a1a696a6507ee75e712817bd27dacdb5 for mcr.microsoft.com/dotnet/core/sdk:3.0 ...
...

$ dotnet tool restore
Tool 'gitversion.tool' (version '5.0.2-beta1.95') was restored. Available commands: dotnet-gitversion

Restore was successful.

$ dotnet tool run dotnet-gitversion /updateassemblyinfo /ensureassemblyinfo
INFO [10/10/19 18:18:06:48] Working directory: /builds/nZeus/simple-extensions/Sources
INFO [10/10/19 18:18:06:49] IsDynamicGitRepository: False
ERROR [10/10/19 18:18:06:51] An unexpected error occurred:
System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception.
 ---> System.DllNotFoundException: Unable to load shared library 'git2-7ce88e6' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libgit2-7ce88e6: cannot open shared object file: No such file or directory
   at LibGit2Sharp.Core.NativeMethods.git_libgit2_init()
   at LibGit2Sharp.Core.NativeMethods.InitializeNativeLibrary()
   at LibGit2Sharp.Core.NativeMethods..cctor()
   --- End of inner exception stack trace ---
   at LibGit2Sharp.Core.NativeMethods.git_buf_dispose(GitBuf buf)
   at LibGit2Sharp.Core.Proxy.git_buf_dispose(GitBuf buf)
   at LibGit2Sharp.Core.Handles.GitBuf.Dispose()
   at LibGit2Sharp.Core.Proxy.ConvertPath(Func`2 pathRetriever)
   at LibGit2Sharp.Core.Proxy.git_repository_discover(FilePath start_path)
   at LibGit2Sharp.Repository.Discover(String startingPath)
   at GitVersion.GitPreparer.GetProjectRootDirectory() in D:\a\1\s\src\GitVersionCore\GitPreparer.cs:line 160
   at GitVersion.Configuration.ConfigFileLocator.Verify(GitPreparer gitPreparer, IFileSystem fileSystem) in D:\a\1\s\src\GitVersionCore\Configuration\ConfigFileLocator.cs:line 56
   at GitVersion.Program.VerifyConfiguration(Arguments arguments, IFileSystem fileSystem) in D:\a\1\s\src\GitVersionExe\Program.cs:line 155
   at GitVersion.Program.VerifyArgumentsAndRun() in D:\a\1\s\src\GitVersionExe\Program.cs:line 101
INFO [10/10/19 18:18:06:52] 
INFO [10/10/19 18:18:06:52] Attempting to show the current git graph (please include in issue): 
INFO [10/10/19 18:18:06:52] Showing max of 100 commits

Unfortunately the mcr.microsoft.com/dotnet/core/sdk:3.0 image uses the Debian10 version that the library we rely on does not yet support. What I did as workaround in the PR for .net core 3.0 feature is I added .net core on top of a debian 9 that is supported and installed dotnet core and then the global tool works.

Ah, currently I am using the GitVersion (preview) task in AzureDevOps. Does that auto-pick up the new version as well? Or is there a way to "force" it to download the latest tool?

@arturcic I tested the beta package, looks good on my end. Thank you for the quick turnaround.

Great, we'll be deprecating the old extension (GitTools/GitVersion) in favor or the new one (GitTools/UseGitVersion)

Is there anyone reason a new extension was needed instead of bumping the major version? I found it disruptive on the builds as I now have to update the actual extension instead of just GitVersion@5 for example? I'd like to understand if there is a limitation to the existing versioning as I've used that in the past with extensions to handle those breaking changes

The reason is the way we are publishing the tool has changed. Previously we were embedding the tool with all dependencies for all supported platforms, meaning it was a huge extension in size and we got to the size limit for an extension. We change the approach and now we install the tool from nuget as global tool. It's basically a new extension

Was this page helpful?
0 / 5 - 0 ratings