Im using entity framework code first. When starting the application the application tries to create the database on SQLServer2008R2.
The error message that I'm receiving is:
"Login failed for user "NT instans\Networkservice" Failed to open the explicitly specified database"
After looking more carefully at the problem in the SQLServer log i can see that the error code is: 18456 severity 14 with state 38. Read about it on: http://sql-articles.com/articles/troubleshooting/troubleshooting-login-failed-error-18456/
Do anybody have a idea how to solve this problem?
I just thought I'd put a solution here that I found after wasting between two programmers too much time: delete the .suo file. I realise the initial question was asked 18 months ago but it might save someone coming across this question in the future.
We tried installing different versions of Visual Studio, deleting localdb instances, logging in as SA, everything.
I faced very similar issue in a web API project in VS 2015 today. I did a clean operation on my C# web API project from solution explorer and it just worked. This was quite crazy. The same sa credential (configured in web.config file of my project) was working throughout the day and it suddenly stops working out of no where.
Many other posts including this one suggest deleting *.suo files but I believe Visual Studio isn't creating *.suo files any more. I didn't see them at least in my VS 2015 environment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With