You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug dotnet pack will fail with a DirectoryNotFoundException when building a project that includes GitVersion.MsBuild and where IsPackable=false.
Expected Behavior
dotnet pack should succeed as if GitVersion.MsBuild was not there.
Actual Behavior
dotnet pack fails because GitVersion does not generate the GitVersionInformation.g.cs file:
C:\Users\cdonnelly\.nuget\packages\gitversion.msbuild\5.6.11\tools\GitVersion.MsBuild.targets(110,9): error : DirectoryNotFoundException: Could not find a part of the path 'D:\temp\marklar\obj\Debug\GitVersionInformation.g.cs'. [D:\temp\marklar\marklar.csproj]
We are hitting this in a solution which contains a large number of NuGet packages and also includes their test projects, and in which we are importing GitVersion.MsBuild into all in a Directory.Build.props file.
The good news is I can easily work around this by adding an IsPackable check to my Include. The ideal path may be to just short-circuit out if IsPackable is false, but I don't know how this would affect a project with both NuGet and non-NuGet deployable packages that need versioning.
Your Environment
Windows 10 x64, Version 21H1 (OS Build 19043.1165)
Link to your CI build (if appropriate): The actual project and CI build are on an internal company GitHub Enterprise instance; the sample project replicates the bug in a much more minimalist fashion.
The text was updated successfully, but these errors were encountered:
Describe the bug
dotnet pack
will fail with aDirectoryNotFoundException
when building a project that includes GitVersion.MsBuild and where IsPackable=false.Expected Behavior
dotnet pack
should succeed as if GitVersion.MsBuild was not there.Actual Behavior
dotnet pack
fails because GitVersion does not generate theGitVersionInformation.g.cs
file:Steps to Reproduce
dotnet pack
Context
We are hitting this in a solution which contains a large number of NuGet packages and also includes their test projects, and in which we are importing GitVersion.MsBuild into all in a
Directory.Build.props
file.The good news is I can easily work around this by adding an
IsPackable
check to myInclude
. The ideal path may be to just short-circuit out ifIsPackable
is false, but I don't know how this would affect a project with both NuGet and non-NuGet deployable packages that need versioning.Your Environment
The text was updated successfully, but these errors were encountered: