Web application network or sql error when trying to launch instance of site via Internet Information Services

-1

Trying to do this exercise. I have an issue. I'm trying to launch an instance of this API. I'm installing the files locally and trying to publish the site/ api via Internet Information Services (IIS). My files / site are supposed to be communicating with a company's server and the web app is therefore supposed to launch. The directions have me install SQL Server Express local db, which is the utility that I believe is supposed to help communicate with the company's server. By the way, I'm on Windows 10.

When I follow all the directions and hit browse on the site from IIS, I keep getting this error. Can anyone please possibly help me?? I have tried all sorts of stuff. The sql express local db doesn't even have a UI so I've been able to start it from command line, so I know it's running, but still nothing. Anyone?

[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: 50 - Local Database Runtime error occurred. Cannot create an automatic instance. See the Windows Application event log for error details. )]

please click here to see the error screen I keep getting in browser upon trying to launch instance of this web application/api

please click here to see the error screen I keep getting in browser upon trying to launch instance of this web application/api

sql-server
api
networking
web-applications
asked on Stack Overflow Jul 29, 2018 by user10146520 • edited Jul 29, 2018 by marc_s

1 Answer

0

Check this blog post: https://blogs.msdn.microsoft.com/sqlexpress/2011/12/08/using-localdb-with-full-iis-part-1-user-profile/

So basically you need to set setProfileEnvironment=true and loadUserProfile=true for your application pool. loadUserProfie setting can be set using Applicaiton Pool advanced setting via IIS Manager but setProfileEnvironment requires editing ofApplcationHost.config file

  1. Go to C:\Windows\System32\inetsrv\config and open applicationHost.config in text editor.
  2. Search for your applicaiton pool name e.g. DefaultAppPool
  3. Set loadUserProfile="true" setProfileEnvironment="true" for your application pool:

    <add name="DefaultAppPool" loadUserProfile="true" setProfileEnvironment="true"

    Remember to restart Application pool after editing the file.

Hope this helps

answered on Stack Overflow Jul 29, 2018 by Mohsin Mehmood

User contributions licensed under CC BY-SA 3.0