2

I am attempting to connect to two MSSQL servers using SQL Authentication. When I run my application on my machine with dotnet run, it can connect to both of the databases. When I put the application into a Docker container, the application can only connect to one of the databases. I get no error or timeout. It just sits there at 100% CPU. Both databases are on the same network and I have been told that there is no internal firewall.

I have it logging out its connection string during the OnConfiguring step of creating the context and the connection string is correct. I have tried using both the fully qualified domain name of the server as well as its IP address.

Any ideas on why I cannot connect to this server?

1 Answer 1

6

I found the resolution. https://github.com/dotnet/core/issues/3550#issuecomment-538608972 held the answer. Basically I switched over to the alpine variant of dotnet images.

There is an issue with the default images of dotnet apparently.

I also had to add the following to my Dockerfile to get over an error message saying, "Globalization Invariant Mode is not supported."

RUN apk add --no-cache icu-libs
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
Sign up to request clarification or add additional context in comments.

1 Comment

This got me past one issue, but now I still have TCP transport errors. I'm using .NET 3.1.x + Alpine 3.12 (3.13 doesn't allow using apk for cert reasons?). Dapper works with a direct query, OData + EntityFramework does not work. Everything works very quickly locally on Windows.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.