I have a simple asp .net web project I'm working on, and while normally everything is going fine, if I try to debug the site, I get "SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified". I'm not sure if its a weird code issue or a weird SQL Server Issue, but here are the system specs anyway.
My dev machine is Windows 7 32-bit, and a Windows Server 2008 VM (on the same Windows 7 Machine) runs both IIS and SQL Server 2开发者_开发知识库008 Express. I haven't had any other problems with the connection string I'm using, and I'm using the simple SA account.
Anyhow, thanks for the help.
I had a problem like this, which I asked and self-answered here.
My problem was Visual Studio was using a default app.config and thus a default connection string, instead of the one in my app.config, because I had put my app.config in its own directory, and the link VS uses to find the app.config is in the .proj file, which VS also occasionally changes to a default file path (I'm not sure what makes it do it, but it keeps happening randomly once a month or so). So when this happens, I need to go remove the XML node it auto-inserts in the .proj file.
Your problem might be the same or related. I.e., probably in debug mode, it's using the wrong config file and/or connection string. I figured this out by debugging and seeing what connection string it was actually trying to use at run-time, and then searching the whole solution for that wrong connection string, and where THAT was, and what referenced THAT, etc.
精彩评论