Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] GitVersion.MsBuild 5.6.7 The command ""C:\Users\UserName\.nuget\packages\gitversion.msbuild\5.6.7\tools\net48/gitversion.exe" "C:\Users\UserName\Documents\source\repos\MyRepo.Test" -output file -outputfile obj\gitversion.json" exited with code 1. #2631

Closed
yggdrasil-tynor opened this issue Mar 25, 2021 · 8 comments · Fixed by #3064
Labels
Milestone

Comments

@yggdrasil-tynor
Copy link

Describe the bug
Building a project with GitVersion.MsBuild 5.6.7 produces:
The command ""C:\Users\UserName\.nuget\packages\gitversion.msbuild\5.6.7\tools\net48/gitversion.exe" "C:\Users\UserName\Documents\source\repos\MyRepo.Test" -output file -outputfile obj\gitversion.json" exited with code 1.

  • Version Used: GitVersion.MsBuild 5.6.7
  • Operating System and version (Windows 10, Ubuntu 18.04): Windows 10

Possibly related to: #2566

@kaflake
Copy link

kaflake commented Mar 26, 2021

I have the same problem with windows 10 in a .net 5.0 project.

@Wufflez
Copy link

Wufflez commented Mar 26, 2021

I also have this problem, Windows 10 and .NET Framework 4.7.2 project. Downgrading to 5.6.6 fixes the problem for me, not sure why 5.6.7 doesn't work.

@cicidellzhao
Copy link

Describe the bug
Building a project with GitVersion.MsBuild 5.6.7 produces:
The command ""C:\Users\UserName\.nuget\packages\gitversion.msbuild\5.6.7\tools\net48/gitversion.exe" "C:\Users\UserName\Documents\source\repos\MyRepo.Test" -output file -outputfile obj\gitversion.json" exited with code 1.

  • Version Used: GitVersion.MsBuild 5.6.7
  • Operating System and version (Windows 10, Ubuntu 18.04): Windows 10

Possibly related to: #2566

I have the same problem with windows 10 in a .net 5.0 project.

@ejmarino
Copy link

I had the same error. I had missing GitVersion.yml in the root directory and the git repo didn't have any commits 😅
After that, it worked like a charm 😍

@danielmarbach
Copy link
Contributor

We ran into a similar issue but this time the problem was that we had a project specific Gitversion.yml. We could workaround the issue by adding

  <!-- Workaround to make sure GitVersion uses the project specific config file -->
  <PropertyGroup>
    <GitVersion_ToolArgments>$(GitVersion_ToolArgments) -config "$(MSBuildProjectDirectory)\GitVersion.yml"</GitVersion_ToolArgments>
  </PropertyGroup>

@kaflake
Copy link

kaflake commented Apr 23, 2021

With version 5.6.8 the problem is the same :(
We have not gitversion.yml, cause we are happy with the default options.

@ChristianPerner
Copy link

ChristianPerner commented Apr 26, 2021

@ALL: Do you see the same exception & call stack:

1>System.NullReferenceException: Object reference not set to an instance of an object.
1>   at GitVersion.GitObject..ctor(GitObject innerGitObject) in D:\a\GitVersion\GitVersion\src\GitVersion.LibGit2Sharp\Git\GitObject.cs:line 12
1>   at GitVersion.Commit..ctor(Commit innerCommit) in D:\a\GitVersion\GitVersion\src\GitVersion.LibGit2Sharp\Git\Commit.cs:line 15
1>   at GitVersion.GitRepository.<>c__DisplayClass27_0.<FindMergeBase>b__0() in D:\a\GitVersion\GitVersion\src\GitVersion.LibGit2Sharp\Git\GitRepository.cs:line 60
1>   at Polly.Policy`1.<>c__DisplayClass11_0.<Execute>b__0(Context ctx, CancellationToken ct)
1>   at Polly.Retry.RetryEngine.Implementation[TResult](Func`3 action, Context context, CancellationToken cancellationToken, ExceptionPredicates shouldRetryExceptionPredicates, ResultPredicates`1 shouldRetryResultPredicates, Action`4 onRetry, Int32 permittedRetryCount, IEnumerable`1 sleepDurationsEnumerable, Func`4 sleepDurationProvider)
1>   at Polly.Retry.RetryPolicy`1.Implementation(Func`3 action, Context context, CancellationToken cancellationToken)
1>   at Polly.Policy`1.Execute(Func`3 action, Context context, CancellationToken cancellationToken)
1>   at GitVersion.GitRepository.FindMergeBase(ICommit commit, ICommit otherCommit) in D:\a\GitVersion\GitVersion\src\GitVersion.LibGit2Sharp\Git\GitRepository.cs:line 58
1>   at GitVersion.RepositoryStore.FindMergeBase(IBranch branch, IBranch otherBranch) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\RepositoryStore.cs:line 49
1>   at GitVersion.RepositoryStore.<>c__DisplayClass29_0.<GetMergeCommitsForBranch>b__2(IBranch otherBranch) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\RepositoryStore.cs:line 466
1>   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
1>   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
1>   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
1>   at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__1.MoveNext()
1>   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
1>   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
1>   at GitVersion.RepositoryStore.GetMergeCommitsForBranch(IBranch branch, Config configuration, IEnumerable`1 excludedBranches) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\RepositoryStore.cs:line 450
1>   at GitVersion.RepositoryStore.FindCommitBranchWasBranchedFrom(IBranch branch, Config configuration, IBranch[] excludedBranches) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\RepositoryStore.cs:line 328
1>   at GitVersion.Configuration.BranchConfigurationCalculator.InheritBranchConfiguration(IBranch targetBranch, BranchConfig branchConfiguration, ICommit currentCommit, Config configuration, IList`1 excludedInheritBranches) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Configuration\BranchConfigurationCalculator.cs:line 84
1>   at GitVersion.Configuration.BranchConfigurationCalculator.GetBranchConfiguration(IBranch targetBranch, ICommit currentCommit, Config configuration, IList`1 excludedInheritBranches) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Configuration\BranchConfigurationCalculator.cs:line 47
1>   at GitVersion.GitVersionContextFactory.Create(GitVersionOptions gitVersionOptions) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitVersionContextFactory.cs:line 40
1>   at System.Lazy`1.CreateValue()
1>   at System.Lazy`1.LazyInitValue()
1>   at GitVersion.VersionCalculation.NextVersionCalculator.FindVersion() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\VersionCalculation\NextVersionCalculator.cs:line 32
1>   at GitVersion.GitVersionCalculateTool.CalculateVersionVariables() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitVersionCalculateTool.cs:line 52
1>   at GitVersion.GitVersionExecutor.RunGitVersionTool(GitVersionOptions gitVersionOptions) in D:\a\GitVersion\GitVersion\src\GitVersion.App\GitVersionExecutor.cs:line 61

@asbjornu asbjornu mentioned this issue Apr 2, 2022
5 tasks
@asbjornu asbjornu added this to the 5.x milestone Apr 2, 2022
@arturcic arturcic modified the milestones: 5.x, 5.10.0 Apr 14, 2022
@github-actions
Copy link

🎉 This issue has been resolved in version 5.10.0 🎉
The release is available on:

Your GitReleaseManager bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants