I spent 5 hours today chasing down what I thought was a SQL server error to finally find out it was a problem with nested web.config files. When I came in this morning I was told that a web service that had worked for many months wasn't working. When I checked the event log on the web server it had an error that the SQL server did not exist. That usually means that the user can not log in. I tried logging into the SQL server and it failed so I set the password back to the value that I know it should be and was able to log in. I thought the problem was that someone else had changed the password without telling me. The only problem was that the error didn't go away.
After trying a lot of different things I was finally able to use a different program to call the web service and I got a message back that the version of the DLL that I am using from the configuration management application block didn't match with the version in the assembly manifest. I thought that was strange but maybe someone had copied a newer version of the .DLL into the bin directory so I uninstalled and reinstalled the web service. Still I was getting the version mismatch error from the web service and the SQL server connection error in the event log.
I finally found someone who had a similar error on the Internet. The resolution that they posted was to look at a virtual directory higher up and see if there is a web.config file there that has slightly different settings. Sure enough in the wwwroot directory there was a web.config file that had been copied from a different virtual directory. It had slightly different settings for the configuration management application block DLLs. When I deleted that web.config everything started working again. I don't know why the original error message said that it couldn't connect to the SQL server but if it hadn't told me that I might not have wasted so much time looking at the SQL server.
Powered by: newtelligence dasBlog 2.1.8102.813
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2009, Scott Golightly
E-mail