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
The current implementation of the Strawberry Shake version check calls "dotnet --version", captures the result into a build variable, and tests the version using VersionGreaterThanOrEquals(). Any additional content output by the dotnet CLI will corrupt the version and cause this check to fail. The check either needs to use an alternate approach to retrieve the version that is not subject to this or needs to filter the output to eliminate extraneous information and retain only the version number.
The specific condition that we encountered this was because the dotnet CLI will generate warning messages if the "en_US.UTF-8" locale is not set up on your system even if it is not actually used. The warning message is: /usr/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8).
This will fail a Strawberry Shake build with the error: /opt/app-root/.nuget/packages/strawberryshake.server/13.1.0/build/StrawberryShake.Server.targets(38,20): error MSB4184: The expression "[MSBuild]::VersionGreaterThanOrEquals(/usr/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8);/usr/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8);6.0.120, 6)" cannot be evaluated. Version string was not in a correct format..
In this case, we were able to work around the problem by updating our containers to add the locale expected by the dotnet CLI. This problem would exist, however, for any additional output generated by the dotnet CLI even in other conditions.
Steps to reproduce
On a system that does NOT have the "en_US.UTF-8" locale defined, do a build of a Strawberry Shake application.
Relevant log output
Microsoft (R) Build Engine version 17.0.1+b177f8fa7 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
Restored /opt/app-root/source/SolutionFolder/ProjectName.csproj (in 636 ms).
/usr/bin/sh : warning : setlocale: LC_ALL: cannot change locale (en_US.UTF-8) [/opt/app-root/source/SolutionFolder/ProjectName.csproj]
/usr/bin/sh : warning : setlocale: LC_ALL: cannot change locale (en_US.UTF-8) [/opt/app-root/source/SolutionFolder/ProjectName.csproj]
/opt/app-root/.nuget/packages/strawberryshake.server/13.1.0/build/StrawberryShake.Server.targets(38,20): error MSB4184: The expression "[MSBuild]::VersionGreaterThanOrEquals(/usr/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8);/usr/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8);6.0.120, 6)" cannot be evaluated. Version string was not in a correct format. [/opt/app-root/source/SolutionFolder/ProjectName.csproj]
Build FAILED.
/usr/bin/sh : warning : setlocale: LC_ALL: cannot change locale (en_US.UTF-8) [/opt/app-root/source/SolutionFolder/ProjectName.csproj]
/usr/bin/sh : warning : setlocale: LC_ALL: cannot change locale (en_US.UTF-8) [/opt/app-root/source/SolutionFolder/ProjectName.csproj]
/opt/app-root/.nuget/packages/strawberryshake.server/13.1.0/build/StrawberryShake.Server.targets(38,20): error MSB4184: The expression "[MSBuild]::VersionGreaterThanOrEquals(/usr/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8);/usr/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8);6.0.120, 6)" cannot be evaluated. Version string was not in a correct format. [/opt/app-root/source/SolutionFolder/ProjectName.csproj]
2 Warning(s)
1 Error(s)
Additional Context?
No response
Version
13.4.0
The text was updated successfully, but these errors were encountered:
Some commentary on the specific locale warnings mentioned in our situation can be found in this Stack article: https://stackoverflow.com/a/76283533.
The change triggering this problem came from this pull request: #6012
Is there an existing issue for this?
Product
Strawberry Shake
Describe the bug
The current implementation of the Strawberry Shake version check calls "dotnet --version", captures the result into a build variable, and tests the version using VersionGreaterThanOrEquals(). Any additional content output by the dotnet CLI will corrupt the version and cause this check to fail. The check either needs to use an alternate approach to retrieve the version that is not subject to this or needs to filter the output to eliminate extraneous information and retain only the version number.
The specific condition that we encountered this was because the dotnet CLI will generate warning messages if the "en_US.UTF-8" locale is not set up on your system even if it is not actually used. The warning message is: /usr/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8).
This will fail a Strawberry Shake build with the error: /opt/app-root/.nuget/packages/strawberryshake.server/13.1.0/build/StrawberryShake.Server.targets(38,20): error MSB4184: The expression "[MSBuild]::VersionGreaterThanOrEquals(/usr/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8);/usr/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8);6.0.120, 6)" cannot be evaluated. Version string was not in a correct format..
In this case, we were able to work around the problem by updating our containers to add the locale expected by the dotnet CLI. This problem would exist, however, for any additional output generated by the dotnet CLI even in other conditions.
Steps to reproduce
Relevant log output
Additional Context?
No response
Version
13.4.0
The text was updated successfully, but these errors were encountered: