how to deploy asp net mvc 4 application using localdb to local iis on windows 7

how to deploy asp net mvc 4 application using localdb to local iis on windows 7  using -',.net,iis,windows-7,localdb'

When I try to run my ASP.NET MVC 4 application using Local IIS on Windows 7 with Visual Studio 2013. I run into the following error when the application tries to connect to localDB\v11.0

  Server Error in '/' Application.
  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. )
  The 2 event logs are
  Unexpected error occurred while trying to access the LocalDB instance
  registry configuration. See the Windows Application event log for
  error details.
  Cannot get a local application data path. Most probably a user profile
  is not loaded. If LocalDB is executed under IIS, make sure that
  profile loading is enabled for the current user.

Most solutions I found online references this post:

The only difference I see between the described situation and my situation is that the described error code is 0 whereas my error code is 50. However, the proposed solution does not work for me.

I cannot get past this error even if I set modify setProfileEnvironment to true and I've spent hours of time playing around with different processModel parameters and application pools.

asked Oct 11, 2015 by deepak gupta
0 votes

3 Answers

0 votes

I was also suffering from same problem but there is so small solution for it just go in iis server than to application pool from which you application is running and in advance setting of application pool we will get the option of Process Model under which there is identity which is by default application pool identity just change it to Local System and your done

And Remember to Put App_Data Folder their in WWW folder of IIS server

answered Oct 11, 2015 by girisha
0 votes

Try this,this will solve your problem:

Edit the applicationHost.config file found in %windir%\system32\inetsrv\config\ specifically the ApplicationPools section.

Change the IdentityType to NetworkService to use newly created database.


answered Oct 11, 2015 by tejas lakhani
0 votes

Make sure that the application pool uses an identity that has access to the desired instance of the LocalDB.

Then disable ASP.NET Impersonation in Authentication settings of the application. Otherwise, application uses IUSR_MachineName account to access the database.

This setup may not be suitable for production environment but could be sufficient for database and application development.

answered Oct 11, 2015 by virendra.bajaj