Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Package manager cannot connect to SQL server in VS 2015 #1166


User avatar
0
rickwheeler created

Hi, I'm new to Abp and have downloaded the template including module zero. I've compiled ok, set the startup project to .Web and the default project to EF as per the doco. My connection string is:

<add name="Default" connectionString="Server=(localdb)MSSQLLocalDB; Database=FreightHub; Trusted_Connection=True;" providerName="System.Data.SqlClient" />

However the Package Manager console always fails with the following error:

Target database is: 'FreightHub' (DataSource: (localdb)MSSQLLocalDB, Provider: System.Data.SqlClient, Origin: Configuration).
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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) ---> System.ComponentModel.Win32Exception (0x80004005): The network path was not found

I can connect to the database server in both SQL Server Object Explorer and SQL 2014 Management Studio. It seems to be just limited to this project (works ok in other projects)

Please help! Rick.


1 Answer(s)
  • User Avatar
    0
    rickwheeler created

    Hi, I have found a workaround to this issue by changing the Web.config connection entry to:

    &lt;add name=&quot;Default&quot; connectionString=&quot;Server=(localdb)\ProjectsV13; Database=FreightHub; Trusted_Connection=True;&quot; providerName=&quot;System.Data.SqlClient&quot; /&gt;
    

    This works for now but is version specific and I'd still like to figure out why (localdb)MSSQLLocalDB is not working. Any suggestion would be appreciated. Rick.