Search code examples
asp.netsql-serverdockerlocaldb

Cannot debug locally in Visual Studio with Docker support and Visual Studio provided SQL Server


I have a ASP.NET 5.0 Web API using Entity Framework to access SQL Server. Running (F5) from Visual Studio works fine. The connection string is Server=(localDB)\\MSSQLLocalDB;Database=***;Integrated Security=true

I then add docker support. Now if I debug the app with the Docker profile I get a System.PlatformNotSupportedException: LocalDB is not supported on this platform.

What should I do to make it work?


Solution

  • LocalDB requires named pipes, which is not available in your docker (Linux) environment. Use SQL Server Express instead, and remember to enable TCP/IP protocol for remote connections.