4.0.1-beta1-58: dotnet build crashes with error MSB4044: The "GetAssemblyVersion" task was not given a value for the required parameter "NuGetVersion"

See original GitHub issue

My project is multi-targeting net471 and netcoreapp2.1. The same error occurs when I build both targets and when I build either one individually.

There is a mismatch between SDK NuGet version (4.9.2) and the NuGet version the task factory was compiled against (4.9.0).
[NuGet Minimal]: Restoring packages for C:\Users\will\.nuget\packages\gitversiontask\4.0.1-beta1-58\build\functionality\GitVersionBuild.targets...
[NuGet Minimal]: Restoring packages for C:\Users\will\.nuget\packages\gitversiontask\4.0.1-beta1-58\build\functionality\GitVersionBuild.targets...
There is a mismatch between SDK NuGet version (4.9.2) and the NuGet version the task factory was compiled against (4.9.0).
MSBUILD : warning : WARN [12/21/18 11:25:46:12] Could not determine assembly version: System.Runtime.InteropServices.MarshalDirectiveException: StrictFilePathMarshaler must be used on a FilePath. [C:\Work\Redacted\Redacted\Redacted.csproj]
MSBUILD : warning :    at LibGit2Sharp.Core.StrictFilePathMarshaler.MarshalManagedToNative(Object managedObj) in C:\projects\libgit2sharp\LibGit2Sharp\Core\FilePathMarshaler.cs:line 71 [C:\Work\Redacted\Redacted\Redacted.csproj]
MSBUILD : warning :    at System.StubHelpers.MngdRefCustomMarshaler.ConvertContentsToNative(IntPtr pMarshalState, Object& pManagedHome, IntPtr pNativeHome) [C:\Work\Redacted\Redacted\Redacted.csproj]
MSBUILD : warning :    at LibGit2Sharp.Core.NativeMethods.git_repository_discover(GitBuf buf, FilePath start_path, Boolean across_fs, FilePath ceiling_dirs) [C:\Work\Redacted\Redacted\Redacted.csproj]
MSBUILD : warning :    at LibGit2Sharp.Core.Proxy.ConvertPath(Func`2 pathRetriever) in C:\projects\libgit2sharp\LibGit2Sharp\Core\Proxy.cs:line 3553 [C:\Work\Redacted\Redacted\Redacted.csproj]
MSBUILD : warning :    at LibGit2Sharp.Repository.Discover(String startingPath) in C:\projects\libgit2sharp\LibGit2Sharp\Repository.cs:line 645 [C:\Work\Redacted\Redacted\Redacted.csproj]
MSBUILD : warning :    at GitVersion.GitPreparer.GetDotGitDirectory() in C:\projects\gitversion\src\GitVersionCore\GitPreparer.cs:line 163 [C:\Work\Redacted\Redacted\Redacted.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:\Work\Redacted\Redacted\Redacted.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:\Work\Redacted\Redacted\Redacted.csproj]
There is a mismatch between SDK NuGet version (4.9.2) and the NuGet version the task factory was compiled against (4.9.0).
MSBUILD : warning : WARN [12/21/18 11:25:46:20] Could not determine assembly version: System.Runtime.InteropServices.MarshalDirectiveException: StrictFilePathMarshaler must be used on a FilePath. [C:\Work\Redacted\Redacted\Redacted.csproj]
MSBUILD : warning :    at LibGit2Sharp.Core.StrictFilePathMarshaler.MarshalManagedToNative(Object managedObj) in C:\projects\libgit2sharp\LibGit2Sharp\Core\FilePathMarshaler.cs:line 71 [C:\Work\Redacted\Redacted\Redacted.csproj]
MSBUILD : warning :    at System.StubHelpers.MngdRefCustomMarshaler.ConvertContentsToNative(IntPtr pMarshalState, Object& pManagedHome, IntPtr pNativeHome) [C:\Work\Redacted\Redacted\Redacted.csproj]
MSBUILD : warning :    at LibGit2Sharp.Core.NativeMethods.git_repository_discover(GitBuf buf, FilePath start_path, Boolean across_fs, FilePath ceiling_dirs) [C:\Work\Redacted\Redacted\Redacted.csproj]
MSBUILD : warning :    at LibGit2Sharp.Core.Proxy.ConvertPath(Func`2 pathRetriever) in C:\projects\libgit2sharp\LibGit2Sharp\Core\Proxy.cs:line 3553 [C:\Work\Redacted\Redacted\Redacted.csproj]
MSBUILD : warning :    at LibGit2Sharp.Repository.Discover(String startingPath) in C:\projects\libgit2sharp\LibGit2Sharp\Repository.cs:line 645 [C:\Work\Redacted\Redacted\Redacted.csproj]
MSBUILD : warning :    at GitVersion.GitPreparer.GetDotGitDirectory() in C:\projects\gitversion\src\GitVersionCore\GitPreparer.cs:line 163 [C:\Work\Redacted\Redacted\Redacted.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:\Work\Redacted\Redacted\Redacted.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:\Work\Redacted\Redacted\Redacted.csproj]
C:\Program Files\dotnet\sdk\2.1.502\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:\Work\Redacted\Redacted\Redacted.csproj]

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:12
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
rafamerlincommented, Jan 17, 2019

Hey guys, had the same issue, but on version 4.0.0 (not the beta). The reason was I had just created a new project and added Gitversion without ever committing anything to the project. After I created my first commit the issue stopped happening.

Possibly not the same issue though.

4reactions
bonesoulcommented, Sep 24, 2019

same issue on dot net core 3 project

Read more comments on GitHub >

github_iconTop Results From Across the Web

4.0.1-beta1-58: dotnet build crashes with error MSB4044
4.0.1-beta1-58: dotnet build crashes with error MSB4044: The "GetAssemblyVersion" task was not given a value for the required parameter " ...
Read more >
net core - Dotnet build crashes with Docker
As I am new with Docker, I have no idee. Does anybody know, why or how can I solve it? I am using...
Read more >
Diagnosing an ASP.NET Core hard crash
Yesterday when trying to change my error handling code significantly, I found that the web server was crashing hard, with no obvious trace ......
Read more >
Setting assembly and nuget package metadata in .NET Core
In this blog post, I will show you what project's metadata should we set, how they relate to each other and how they...
Read more >
'1.0.0- ' is not a valid version string. : RIDER-10742 - YouTrack
I get the following error when opening any our of solutions. All projects are using the new csproj format and normally maintained in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found