I have a MVC project (download from here). I can run this without any error from Visual Studio. But if I hosted the project into IIS using a tool (code from here). If I launch the page from web browser, it shows error as "Local Database Runtime error occurred" like below screenshot.
Asked
Active
Viewed 1,914 times
0
-
Please make sure that Service for SQL server is running.. – mmushtaq Jul 22 '16 at 12:59
-
In your dev environment you are pointing to a local instance of Sql Server, right?....now, when you deploy your site to IIS is in another server, am I correct? – Hackerman Jul 22 '16 at 13:22
-
@user55 How can I check it? – Mathivanan KP Jul 26 '16 at 04:35
-
@Hackerman What to do to resolve this? – Mathivanan KP Jul 26 '16 at 04:36
-
[this](http://stackoverflow.com/questions/26248293/sql-network-interfaces-error-50-local-database-runtime-error-occurred-canno) and [this](https://blogs.msdn.microsoft.com/gaurav/2013/12/21/deployment-of-sql-express-localdb-on-iis/) can be helpful for you.. – mmushtaq Jul 26 '16 at 04:49
-
[this](https://blogs.msdn.microsoft.com/gaurav/2013/12/21/deployment-of-sql-express-localdb-on-iis/) helped me. Thanks. – Mathivanan KP Jul 27 '16 at 07:18
1 Answers
0
Edit the applicationHost.config file by adding the below child element into the appPool fixed the issue for me.
<processModel identityType="ApplicationPoolIdentity" loadUserProfile="true" setProfileEnvironment="true" />
File location: C:\Windows\System32\inetsrv\config\applicationHost.config
Example:
<add name="SampleAppPool">
<processModel identityType="ApplicationPoolIdentity" loadUserProfile="true" setProfileEnvironment="true" />
</add>

Mathivanan KP
- 1,979
- 16
- 25
-
Note that if you want to edit this file make sure you use a 64 bit text editor like notepad. If you use a 32 bit one like Notepad++ it will automatically edit a different copy of the file in SysWOW64 instead. – Dipen Dedania Mar 20 '17 at 12:45