Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I have just published a MVC application into IIS. My app is using localDB created using SQL Server 2016(shall be version 13.0) and have executed commands SQLLOCALDB CREATE "Projects13" 13.0 -s using cmd. Everything run fine and i have validated using SQLLOCALDB info. Using SSMS to create tables and SPs by connecting to (localDB)\Projects13 and created a DB named "DB_Test".

I tried to run using VS 2017 and retrieve data from db using Entity Framework 6 and everything run fine(all CRUD commands) without any logics broken. But my issue is when i deployed my app into IIS with my URL set to localhost, i cant proceed to my main screen after I login.

Login screen is able to show but after hitting submit the screen just prompt the error as same as title above. After some further troubleshooting, turns out to be the app is unable to connect to the (localDB)\Projects13 I created. Checked again the database and sqllocaldb using cmd and everything is in place. Nothing wrong with my web.config too!

In order to further confirm on that. I run the app using VS again and i was able to login and do subsequent transactions. I have set my Process Model Identity to "LocalSystem", would not sure if this will affect that as i have no access to the IIS due to it is not setup in my laptop.

What I have tried:

1. Change web.config setting.
2. Double check on SQLLOCALDB info and everything is there.
Posted
Updated 2-May-18 17:08pm

1 solution

In order to use localdb with IIS you need to make few adjustments to the IIS configuration. Have a look at Deployment of SQL Express LocalDB on IIS – Gaurav's Blog[^]
 
Share this answer
 
Comments
Jamie888 2-May-18 23:28pm    
Thank you sir. I will give it a try and feedback accordingly.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900