Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have a software installation that includes a Topshelf service and an MVC4 web application. Both need to access the same LocalDb MDF. The development version runs as our users. The installed version runs as LocalSystem.

I'm trying to switch the user (Post-Install) that the installed version runs as so that network paths can be accessible, particularly if IT has prevented adding Machine permissions. If I switch both the users for the service and AppPool (load user profiles is on), and I wait for all previous sqlservr.exe instances to quit, or I explicitly delete the other users instance, I am unable to connect to the instance as the new user. I've tried copying the mdf to a new location and using that instead. I've tried creating and seeding a new mdf as the desired user. It seems no matter what I do I'm unable to connect to the instance. I usually get error 50. Switching back to LocalSystem works fine.

Another oddity is that if I explicitly create the named instance using "sqllocaldb create NamedInstance -s", there will be 2 instances with the same name listed by "sqllocaldb info"! One of those instances, despite being listed, cannot be interacted with. Getting info, stopping, starting, or deleting all return that the instance does not exist after I've removed the other instance with the same name.

NOTE: I can easily switch users on my VMs, so the problems seem related to either doing it on the same machine used to develop and Debug (thus running LocalDB instance through Visual Studio host) or having full SQL Server 2008 and 2012 installed.

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.