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. )]
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
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
User contributions licensed under CC BY-SA 3.0