Issue when deploying an ASP.NET MVC + LocalDB application

That's because LocalDb is not intended for production use.

See article: Creating an Entity Framework Data Model for an ASP.NET MVC Application

Specifically, this text from the article: "Typically SQL Server Express is not used for production web applications. LocalDB in particular is not recommended for production use with a web application because it is not designed to work with IIS."

So change your connectionString value to use a real sql server database and you should be good to go!

I had the same issue and here (Is it normal to use LocalDb in production?) the solution founded. @Krzysztof Kozielczyk@ provides 2 articles: first and second. Tricks from the first was enough to resolve problem in my case. Actually I just added to C:\Windows\System32\inetsrv\config\applicationHost.config

<add name="ASP.NET v4.0" autoStart="true" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated">
     <processModel identityType="ApplicationPoolIdentity" loadUserProfile="true" setProfileEnvironment="true" />

Btw, my connection string looks like your second one (with "|DataDirectory|\Database.mdf").


  1. Peyton

    • 2017/12/9

    Things to try and check: Set the runAllManagedModulesForAllRequests="true" attribute on the <modules> section in your web.config:

  2. Adriel

    • 2016/12/21

    Issue when deploying an ASP.NET MVC + LocalDB application. Ask Question Asked 7 years, 9 months ago. Active 5 years, 7 months ago. Viewed 15k times

  3. Kason

    • 2017/10/29

    403 Forbidden Error. When developing an application, it's standard to deploy it to a staging server and then a production server. Although the 

  4. Finley

    • 2015/7/27

    Issue deploying Asp.Net MVC 4 website to Azure [closed] Ask Question Asked 8 years, 3 months ago. Active 8 years, 3 months ago. Viewed 3k times

  5. Cooper

    • 2017/7/21

    Hi Kumar,. Quote: MVC Hosting tips with database. I would like to let you know while deploying the MVC application in web.config,

  6. Kenny

    • 2018/5/14

    Hi, I started building a website on MVC 3.0 Razor. And I have deployed my website but the urls wont open. It always show me error:403.14 url not found. Im using WebsitePanel as my control panel whi

  7. Reginald

    • 2016/11/7

    And now i want to deploy this project on local host for my machine. And first time I am deploying the mvc project. So I have publish the project 

  8. Francisco

    • 2019/9/18

    I have been through several pages on the docs website along with several other forums looking for a solution. What I am unclear about is. In order to debug do I need to publish/deploy first (which I have also tried and doesn't change anything. I set up a publish profile for localhost and still get 404).

  9. Sean

    • 2015/1/2

    Hello All, When I run my ASP.NET project on Visual Studio, I get a url like this : http://localhost:11111/ or 

  10. Jaxton

    • 2019/8/19

    Step 1. Right-click on your ASP.NET MVC5 application inside Visual Studio and then click "Publish". Step 2. Now, select the "IIS" option from the left menu and click "Create Profile" button. Step 3. Change your publish method to "Web Deploy Package" and provide your package location, then click "Next". Step 4.

  11. Eli

    • 2019/7/27

    Resolved Newbie - I need help to configure Plesk. Issue I deployed to Plesk admin using Mvc. but not working in Godaddy. sangyongjin 

  12. Arian

    • 2017/8/16

    Let’s create a new ASP.NET MVC application. Step 1 − Click Ok and you will see the following dialog. Step 2 − Select MVC template and also check Host in the Cloud checkbox. Click Ok. When the Configure Microsoft Azure Web App Settings dialog appears, make sure that you are signed in to Azure.

  13. Makai

    • 2018/7/27

    Automation eliminates these eleventh-hour problems by removing the human NET MVC application involves deployment to a Windows Server OS environment.

  14. Misael

    • 2017/6/23

    It should just work assuming your project solution is correct. Make sure the file is actually included in the solution (Show all files, right click, 

  15. Tobias

    • 2021/6/3

    I am assuming this is an IIS configuration issue any suggestions as to configuration issues with ASP.NET MVC apps would be appreciated. Any thoughts? Asked By: 

Comments are closed.

Recent Posts