Skip to content

[Bug] GitVersion.MSBuild dotnet pack fails under Linux #2591

Closed
@NameOfTheDragon

Description

@NameOfTheDragon

Describe the bug
My solution builds correctly and sets the TeamCity build number with the correct SemVer. It runs and passes all the unit tests.
Then it fails when running dotnet pack with the following build log output:

13:53:16]	     1>/root/.nuget/packages/gitversion.msbuild/5.6.6/tools/GitVersion.MsBuild.targets(110,9): error : ArgumentException: Unknown language detected: 'en_US:en'
[13:53:16]	/root/.nuget/packages/gitversion.msbuild/5.6.6/tools/GitVersion.MsBuild.targets(110,9): error :    at GitVersion.MsBuild.FileHelper.GetFileExtension(String language) in D:\a\GitVersion\GitVersion\src\GitVersion.MsBuild\Helpers\FileHelper.cs:line 56
[13:53:16]	/root/.nuget/packages/gitversion.msbuild/5.6.6/tools/GitVersion.MsBuild.targets(110,9): error :    at GitVersion.MsBuild.FileHelper.GetFileWriteInfo(String intermediateOutputPath, String language, String projectFile, String outputFileName) in D:\a\GitVersion\GitVersion\src\GitVersion.MsBuild\Helpers\FileHelper.cs:line 143
[13:53:16]	/root/.nuget/packages/gitversion.msbuild/5.6.6/tools/GitVersion.MsBuild.targets(110,9): error :    at GitVersion.MsBuild.GitVersionTaskExecutor.GenerateGitVersionInformation(GenerateGitVersionInformation task) in D:\a\GitVersion\GitVersion\src\GitVersion.MsBuild\GitVersionTaskExecutor.cs:line 57
[13:53:16]	/root/.nuget/packages/gitversion.msbuild/5.6.6/tools/GitVersion.MsBuild.targets(110,9): error :    at GitVersion.MsBuild.GitVersionTasks.<>c__DisplayClass2_0.<GenerateGitVersionInformation>b__0(IGitVersionTaskExecutor executor) in D:\a\GitVersion\GitVersion\src\GitVersion.MsBuild\GitVersionTasks.cs:line 17
[13:53:16]	/root/.nuget/packages/gitversion.msbuild/5.6.6/tools/GitVersion.MsBuild.targets(110,9): error :    at GitVersion.MsBuild.GitVersionTasks.ExecuteGitVersionTask[T](T task, Action`1 action) in D:\a\GitVersion\GitVersion\src\GitVersion.MsBuild\GitVersionTasks.cs:line 30
[13:53:16]	/root/.nuget/packages/gitversion.msbuild/5.6.6/tools/GitVersion.MsBuild.targets(110,9): error :
[13:53:16]	     1>Done Building Project "/opt/buildagent/work/8f12cde64aeec7e3/TA.Ascom.ReactiveCommunications/TA.Ascom.ReactiveCommunications.csproj" (pack target(s)) -- FAILED.
[13:53:16]

(full build log at http://teamcity.tigra-astronomy.com:8111/viewLog.html?buildId=9842&buildTypeId=TigraOss_TaReactiveCommunications&tab=buildLog&branch_TigraOss=hotfix%2F1.3.2)

Expected Behavior

I would expect this step to have succeeded since the build step worked successfully and produced the correct SemVer.
I do not understand how I get different results for dotnet build and dotnet pack.

Actual Behavior

Some crazy error about an "unknown language". Why does it even require a language?

Steps to Reproduce

Unfortunately I'm not able to provide a test solution as I don't really understand the failure mechanism.

Context

It's a showstopper, I'm unable to complete my build. I don't believe there's anything wrong with my solution or build configuration. I'm not aware that GitVersion provides any way for me to pass in a Language parameter so this appears to be purely an internal error.

Your Environment

TeamCity build server
Linux (Ubuntu 20.04) build agent (in a docker container) with GitVersion installed on the agent image.
The solution being built is https://github.com/Tigra-Astronomy/TA.ReactiveCommunications/tree/hotfix/1.3.2
The TeamCity build is http://teamcity.tigra-astronomy.com:8111/viewType.html?buildTypeId=TigraOss_TaReactiveCommunications&branch_TigraOss=hotfix%2F1.3.2&tab=buildTypeStatusDiv

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions