I think it's because I'm not deploying right. My project has a localdb in it because I needed one when I first started the project. Things changed though and now I don't need it. I'd like to delete it, but I'm afraid there might be system functions under the hood that might need a db.
Here's the error:
[Win32Exception (0x80004005): The system cannot find the file specified]
[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 52 - Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled.)]
I guess typically one would exchange the localdb for a remote one on publish. But my app now does all of its data work through web services in another app. If someone logs in I ask the other app if he's OK via service, etc. The other app has its own db. I'm pretty much just a presentation layer at this point.
Can I just delete the localdb and remove Entity Framework from my project? Or are there system functions under the hood that will break (AntiForgeryToken validation, etc.)? I ask because the error seems like an indication that something wants database access.
UPDATE: This whole thing is really weird. First, the error is intermittent. I can access my app 20 times in a row and not get any error at all. Then, all of a sudden I get the error. No number of browser refreshes thereafter fixes things. Just repeatedly get the error. 20 browser refreshes in a row doesn't clear things up. If I go to my browser cookies in Chrome though and delete my AspNet.ApplicationCookie, a browser refresh instantly works. Then I won't see the error again for days. Also, if I just use another browser like Edge when I have the error in Chrome, the other browser works. Chrome continues to error until the cookie is explicitly removed.
There is something in that cookie that is buggered up. Another browser works and deleting the cookie works.
What is in that cookie that has anything at all to do with a SQL connection and what about it goes bad only once in a while?
User contributions licensed under CC BY-SA 3.0