LocalDB works fine in Visual Studio IIS, fails when deployed to full IIS

两盒软妹~` 提交于 2019-12-11 05:41:59

问题


I have a code first localdb database in my MVC 4 project and if I run the application in Visual Studio 2012 it connects fine and everything works. When I publish to my full IIS and access the site the database cannot connect and I get :

"the specified localdb instance does not exist"

I've had other problems, it seems localdb is a nightmare to deploy! I followed all the advice here also: http://blogs.msdn.com/b/sqlexpress/archive/2011/12/09/using-localdb-with-full-iis-part-1-user-profile.aspx

I'm still having no luck, why does it work perfectly in VS IIS Express and not 'real' IIS?

Thanks


回答1:


I would recommend installing and developing against a full instance of SQL server to avoid this problem when deploying to IIS locally.

LocalDB is a very small subset (around 30 MB) of SQL server so you can develop against it with out installing the entire server application. This works very nicely along with IIS Express during development. For deployment, your database for that environment should be hosted an a full fledged SQL Server Express/Developer/Standard/etc and your connection string should be changed to reflect

As you pointed out the post might shed some light on a workaround but only for development using a Local IIS Server (not IIS Express) with LocalDB.



来源:https://stackoverflow.com/questions/15728078/localdb-works-fine-in-visual-studio-iis-fails-when-deployed-to-full-iis

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