SqlClient Should Support localhost in Connection Strings on Linux #23307
Labels
area-System.Data.SqlClient
enhancement
Product code improvement that does NOT require public API changes/additions
os-linux
Linux OS (any supported distro)
Milestone
When using a connection string containing
Data Source=localhost
on linux (in a Docker container in my case) I get the following error:I believe
localhost
should be supported as it's a common scenario and to smooth out the platform inconsistencies. My understanding is that you must use an IP address on linux at the moment. I can't seem to get a working connection to the SQL Server installation on my local machine. My local SQL Server instance does not accept remote connections at the moment, I suspect this is why I cannot connect. I can however, point to a SQL Server public IP address that works.As a workaround, I'm thinking I could programmatically replace
localhost
with the required IP address but I haven't been able to figure out how to do this. Here is a general idea of what I've tried:The text was updated successfully, but these errors were encountered: