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

GetBuildVersion fails with NullReferenceException when version is missing #250

Closed
the-ress opened this issue Nov 8, 2018 · 0 comments
Closed
Assignees
Labels
Milestone

Comments

@the-ress
Copy link

the-ress commented Nov 8, 2018

GetBuildVersion fails with NullReferenceException when the version key is missing in version.json

Expected result:
An informative error message.

Actual result:

The "Nerdbank.GitVersioning.Tasks.GetBuildVersion" task failed unexpectedly.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Nerdbank.GitVersioning.VersionOracle..ctor(String projectDirectory, Repository repo, Commit head, ICloudBuild cloudBuild, Nullable`1 overrideBuildNumberOffset, String projectPathRelativeToGitRepoRoot) in c:\Code\Nerdbank.GitVersioning\src\NerdBank.GitVersioning\VersionOracle.cs:line 101
   at Nerdbank.GitVersioning.VersionOracle.Create(String projectDirectory, String gitRepoDirectory, ICloudBuild cloudBuild, Nullable`1 overrideBuildNumberOffset, String projectPathRelativeToGitRepoRoot) in c:\Code\Nerdbank.GitVersioning\src\NerdBank.GitVersioning\VersionOracle.cs:line 40
   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 forgot to commit the version.json in the subdirectory that specified version.)

@AArnott AArnott added the bug label Nov 8, 2018
@AArnott AArnott self-assigned this Nov 8, 2018
@AArnott AArnott added this to the 2.3 milestone Nov 25, 2018
AArnott added a commit that referenced this issue Nov 26, 2018
AArnott added a commit that referenced this issue Nov 26, 2018
AArnott pushed a commit that referenced this issue Apr 1, 2024
Bumps [dotnet-coverage](https://github.com/microsoft/codecoverage) from 17.10.1 to 17.10.2.
- [Commits](https://github.com/microsoft/codecoverage/commits)

---
updated-dependencies:
- dependency-name: dotnet-coverage
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants