ASP.Net Core 1.1 App running inside docker container cannot connect to Remote Sql Server on Windows
I have an ASP.Net Core Web API running on .Net Core 1.1 is not able to connect to a sql server which is in my network but outside of docker container. I always get connection time out error.
Connection Timeout Expired. The timeout period elapsed during the post-login phase. The connection could have timed out while waiting for server to complete the login process and respond;
App works fine when running outside of the docker container.
Dockerfile:
FROM microsoft/aspnetcore:1.1 WORKDIR /contest EXPOSE 85 EXPOSE 1433 COPY /out . ENTRYPOINT ["dotnet", "contest.dll"]
any help is appreciated. Thank you.
Did you try to do the same thing in just .NET Core, without ASP.NET Core? (basically minimal repro) It would help us identify where the problem might be.
Tried with a .net core console application, same error.
Can you please paste the code?
Did you get chance to try .NET Core 2.0 Preview2?
sorry for the late reply.. I tested on various environments and finally figured out the root cause. My dev sql instance is still on Sql Server 2008 R2 (RTM). I can connect every instance that I have.
Ok, sounds like this issue can be closed. Thanks!