Como adicionar o LocalDB ao SQL Server Object Explorer da Comunidade do Visual Studio 2015?
Problema
Não entendo como fazer o LocalDB aparecer no SQL Server Object Explorer. Em algumas VMs, ele aparece automaticamente, em outras VMs, não. Ainda assim, depois de pesquisar no Google por horas, eu não entendo.
Situação atualEu tenho uma VM limpaInstalei a Comunidade do Visual Studio 2015 (todas as configurações padrão)Deixei um aplicativo de console ser executado (Entity Framework 6, código-primeiro, aplicativo de console) que funcionou em outra VM e criei um banco de dados automaticamente, que então apareceu no SQL Server Object Explorer; mas não desta vezO erro diz:
System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 52 - Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled.) ---> System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
Portanto, nesta VM, nenhum banco de dados é criado e nada aparece no SQL Server Object ExplorerSQL Server
nó.
C:\Users\<username>\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\MSSQLLocalDB
; mas nesta VM, não existe essa pastaoApp.config
sempre parecia assim (e foi criado automaticamente dessa maneira quando instalei o Entity Framework 6, o NuGet Package Manager no Visual Studio):App.config<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>
Outros comentários aleatóriosAnteriormente, com o SQL Server, era necessário abrir determinadas portas, mas o LocalDB é executado, como eu o entendo, como um processo separado sob demanda quando iniciado pelo Visual Studio.Eu não sei como depurar oSQLException
O LocalDB não vem fornecido com a Comunidade do Visual Studio 2015 e preciso instalá-lo separadamente?