SQL server alias recognized in dnx451 but not in dnxcore50
I built a web application utilizing EntityFramework and the new Identity libraries. I also set up a SQL configuration alias in SQL server configuration manager. When running my application with the dnx451 runtime, the database connection is established with no problem and the application functions.
If I switch the runtime to dnxcore50, any attempts to connect to the database from the application fail with the SqlException The network path was not found. Replacing the alias in the connection string and using the actual server name resolves the issue. The connection string I'm using is included below:
"connectionString": "Server=aliasName;Database=dbName;Trusted_Connection=True;MultipleActiveResultSets=true"
@Phasiq any chance you could try this out using DbConnection directly to see if it is an EF specific issue, or an issue in SQL Client itself?
@rowanmiller, thanks for the tip. As suggested, I bypassed EF and tested with a SqlConnection (DbConnection) object and it fails when using a SQL alias in core50 but succeeds in 4.51 and 4.6. It is most definitely not an EF issue.
Any suggestion on where I should report this behavior? It's quite an interesting gotcha to have SQL aliases work in .NET and fail in .NET core, but I suppose it could be by design given the more minimal code base.
The System.Data.SqlClient code will ultimately live in the dotnet/corefx repo. You could try filing an issue there.
@YoungGah FYI
Thanks @bricelam , I have posted it in the corefx repo as suggested.
New issue is https://github.com/dotnet/corefx/issues/2575.