Last post Nov 18, 2008 01:49 PM by haz33
Nov 18, 2008 12:45 PM|haz33|LINK
Hi, I am attempting to load connection strings from my server's machine.config file. On our old server, this worked just fine. We just installed SQL Server, IIS, and Visual Studio on a brand new server. I created a project and, using the same code, made
reference to a connection string that should be retrieved from the machine.config file. Unfortunately, I'm getting an "Object variable or With block variable not set" on the line that references the connection string's name.
When I searched my C:\WINDOWS\Microsoft.NET directory, I found a machine.config in each of these locations:
I added the connection string to the two version 2.0.50727 machine.config files. I didn't do anything to the version 1.1.4322 file because there were no tags for connection strings in that file. This is a 32-bit project so I'd think I'd want to reference
the middle one. What am I doing wrong? Why won't my project see the connection string in the file? Thanks!
Nov 18, 2008 01:49 PM|haz33|LINK
Resolved the problem. I had created another website in IIS and I had deleted the Default Web Site. Not a good idea. Anyhow, to restore it, follow this procedure:
That fixed my machine.config problem as well. Incidentally, my machine is looking at the machine.config file in the Framework64 directory.