简体   繁体   中英

Publishing SQL LocalDB to IIS Server “Server was not found…” Error

so I've got a project that uses a localDB and I want to publish it to an IIS server. If I try to run it it gives me the error:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible.

I've done some research and found this article: Deployment of SQL Express LocalDB on IIS

The article describes the exact problem I'm having but doesn't give a clear answer to solve it(as far as my understanding goes)

The tag below proved to be no use as I tried to put it in the ApplicationInsights.config and Web.Config file with no luck.(The article didn't specify where to put it exactly)

<add name="DefaultAppPool"> <processModel identityType="ApplicationPoolIdentity" loadUserProfile="true" setProfileEnvironment="true" /> </add>

Does anyone have any information or input? Much appreciated.

You should have SQL Server Express service running on your IIS server. If it's not installed you should install it.

And, if you've assigned any particular account for your application pool identity make sure that user has Read/Write permissions to App_Data folder. this is where your local database file is created automatically during the first run.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM