-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
ResolveAssemblyReference fails in invariant mode on Alpine linux with error MSB3095 #3066
Comments
Related to https://github.com/dotnet/cli/issues/8290 btw, in interactive mode, this works for me docker run -it microsoft/dotnet:2.1-sdk-alpine this is dotnet runtime with SDK. After hitting enter, when you get into the container: dotnet new console -n test
cd test
dotnet run
# 'Hello World!' is printed |
@kasper3 - the difference between your scenario and Nate's is a difference in the globalization invariant mode. The runtime images run with the globalization invariant mode enabled while the sdk image doesn't. |
Cool, so currently the workaround is to add: ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT false
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8 in Dockerfile and export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT false
export LC_ALL en_US.UTF-8
export LANG en_US.UTF-8 if you are using interactive shell. |
@kasper3 - you would also need to add |
Yes |
I avoided the catch clause that sucked all the information away and got
So it's a non-generic Hashtable that's throwing. |
Changing it to a generic Dictionary doesn't help, though. Same stack in CompareInfo. |
Ok, so the
Which opts every running application into the globalization invariant mode. Those docs say
So it seems odd that opting into a I think this is a corefx bug so I filed https://github.com/dotnet/corefx/issues/28021 with a small repro. |
The bug in corefx aside, I am not sure why we need to set invariant globalization in Alpine Linux docker, since ICU package is available in their packages for ages and dotnet console/mvc apps just work fine with full globalization support. |
@kasper3 you don't have to set invariant mode in Alpine. That just happens to be the default chosen by https://github.com/dotnet/dotnet-docker. Presumably, this bug would happen in any Linux distro with invariant mode enabled. |
In https://github.com/dotnet/corefx/issues/28021 @rainersigwald has shown that with invariant set in Ubuntu, it works fine. On Alpine, invariant globalization seems to have some issue. Both Ubuntu and Alpine are tested with 2.1 package. |
@kasper3 The reason invariant mode is the default in the dotnet/dotnet-docker Alpine images is to keep the size of the runtime image to a minimal. See dotnet/dotnet-docker-nightly#500 for more details. |
I take it back @natemcmaster, it is reproducible on Debian as well as Alpine: https://github.com/dotnet/corefx/issues/28021#issuecomment-372843375 |
Yeah, sorry that was confusing: I used Ubuntu + runtime 2.0 and Alpine + runtime 2.1 for my examples. |
Just checked with |
Steps to reproduce
Create a dockerfile with these contents:
And execute
docker build . -t test
Expected behavior
I should be able to build a simple console application.
Actual behavior
RAR fails with "error MSB3095: Invalid argument. SafeHandle cannot be null".
https://github.com/Microsoft/msbuild/blob/vs15.6/src/Tasks/Microsoft.Common.CurrentVersion.targets#L2052
Environment data
msbuild /version
output: Microsoft (R) Build Engine version 15.6.82.30579 for .NET CoreOS info: Alpine 3.6 x64
dotnet: 2.1.300-preview2-008251
The text was updated successfully, but these errors were encountered: