title: Publishing ASP.net website With LocalDB
body: <p>I'm trying to publish my website on a different computer that is on my home network. I have set up IIS and SQL Server 2016 Express on that computer. Same version on my development laptop. When I run the site I get the below error. I think the problem might be that I'm trying to us LocalDB. I'm often traveling and in areas where I don't have internet connectivity. This is why I thought it would be best to use localDB while developing. Once I get home I then publish to my Server.</p>
  
  <p>Originally the LocalDB was created on my computer in a folder that was far from my project. So what I did was move it to the app_data so that it would be attached when I publish. </p>
  
  <p>What I tried: </p>
  
  <ol>
  <li>Reinstalled Microsoft SQL Server 2016 (made sure LocalDB was installed)</li>
  <li>Ensured the database was in fact in <code>App_Data</code> folder on server</li>
  <li>Changed connection string to look for database in <code>app_data</code></li>
  </ol>
  
  <p>Any suggestion would be great.</p>
  
  <p>Connection string:</p>
  
  <pre><code>&lt;connectionStrings 
      &lt;add name="IgorsSellersToolBoxDB" 
           connectionString="metadata=res://*/Models.ModelDB.csdl|res://*/Models.ModelDB.ssdl|res://*/Models.ModelDB.msl;provider=System.Data.SqlClient;provider connection string=&amp;quot;data source= LocalDB)\MSSQLLocalDB;attachdbfilename=|DataDirectory|\IgorsSellersToolBoxDB.mdf;integrated security=True;multipleactiveresultsets=True;connect timeout=30;application name=EntityFramework&amp;quot;" 
           providerName="System.Data.EntityClient" /&gt;
  &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>Error:</p>
  
  <blockquote>
    <p>Server error in '/WebToolbox' Application.</p>
    
    <p>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: 50 - Local Database Runtime error occurred. The specified LocalDB instance does not exist.
    )</p>
    
    <p>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.</p>
    
    <p>Exception Details: System.Data.SqlClient.SqlException: 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: 50 - Local Database Runtime error occurred. The specified LocalDB instance does not exist.)</p>
    
    <p>Source error:</p>
    
    <p>An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.`</p>
  </blockquote>