How to deploy ASP.NET MVC 4 application using localDB to local IIS on Windows 7?

微笑、不失礼 提交于 2019-11-27 01:12:10
Neeraj Mehta

I was also suffering from same problem, but there is a solution for it.

Go to the IIS server, and then to the application pool from which your application is running. In the advanced settings of the application pool there is a "Process Model" option, under which there is an "Identity" option. This is by default the application pool identity. Change it to Local System, and you're done.

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

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.

<add name="ASP.NET v4.0" managedRuntimeVersion="v4.0">
   <processModel identityType="NetworkService" loadUserProfile="true" setProfileEnvironment="true" />
</add>

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.

Daarwin

Maybe this will help someone. I had the same problem installing an empty Epise3rver 7.5+ version but it was clear it did not have to do with any settings or configurations since my colleagues did not have this problem. I ended uninstalling all MSSQL-related applications and reinstalled MsSQL Express 2014. And it worked! I tried before to install 2014 but it didn't change anything so as said I then uninstalled everything MsSQL-related before installing 2014 again. Hope it helps.

Using MVC 5.2.3.0 I had a similar issue...added this to my web.config.

<!-- Configure the Sql Membership Provider -->  
<membership defaultProvider="SqlMembershipProvider" userIsOnlineTimeWindow="15">  
  <providers>  
    <clear />  
      <add   
        name="SqlMembershipProvider"   
        type="System.Web.Security.SqlMembershipProvider"   
        connectionStringName="SqlConn"  
        applicationName="MembershipAndRoleProviderSample"  
        enablePasswordRetrieval="false"  
        enablePasswordReset="false"  
        requiresQuestionAndAnswer="false"  
        requiresUniqueEmail="true"  
        passwordFormat="Hashed" />  
  </providers>  
</membership>  

https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/how-to-use-the-aspnet-membership-provider

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!