Is Visual Studio 2010 LocalDB supported in Entity Framework 5?

Is LocalDB supported in Visual Studio 2010 in Entity Framework 5, on .NET 4.0?

Or am I doing it wrong? I get the message "Could not find the network path" when creating an instance of my model container with the connection string for LocalDB.

Here's the connection string:

var connectionString = "metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;provider=System.Data.SqlClient;provider connection string=\"data source=(localdb)\v11.0;initial catalog=fablelane_com_db;integrated security=SSPI;multipleactiveresultsets=True;App=EntityFramework\""; 

Edit 1 When connecting, I get the following error:

When connecting to SQL Server, a network-related or specific instance error occurred. The server was not found or was not available. Verify the instance name is correct and configure SQL Server to connect remotely. (provider: Named Pipes provider, error: 40 - Could not open a connection to SQL Server).

Edit 2 I just realized that switching to the beta version of Visual Studio 11 does not work either. However, you are getting the same error message.

+7
source share
3 answers

The problem was as simple as a missing backslash to avoid my database.

Pay attention to the database name "(localdb) \ v11.0". The backslash in the original connection string is not removed at all, so it treats "\ v" as part of the connection string.

Holding it, specifying "\\v" instead of "\v" .

+6
source

LocalDB is part of SQL Server 2012, so installing EF 5.0 (which behaves like EF 4.3.1 on .NET 4.0) does not work without SQL Server 2012. To use LocalDB from .NET 4.0 you need .NET 4.0.2 , but the question is how it works with VS 2010 tools for EF.

+4
source

It’s a little late to be able to help, but I thought it could help others who walk here (like me).

Step-by-step instructions for using LocalDB with Visual Studio 2010.

http://blogs.msdn.com/b/sqlexpress/archive/2011/11/28/using-localdb-in-visual-studio-2010.aspx

+4
source

All Articles