How do I configure a global connectionString in machine.config on Windows Server 2008 (IIS 7)?

Daniel-
Daniel- used Ask the Experts™
on
I have just moved a large number of ASP.NET 2 applications from Windows Server 2003 and IIS 6 to Windows Server 2008 and IIS 7.  Connection strings are stored in machine.config so that they do not need to be configured for every individual web application.  Under Server 2008 and IIS 7 the connection strings entered into machine.config are invisible/inaccessible.  This must be a configuration issue but I have not been able to diagnose the cause of the problem.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2008

Commented:
Hi,

in IIS7, machine.config is stored in %WINDIR%\System32\InetSrv\Config\applicationhost.config

If you want to delegate control to another machine.config or web.config, you need to delegate that control using the master config file.

refer to this resource for more info:

http://learn.iis.net/page.aspx/156/understanding-iis-70-configuration-delegation/

cheers.
Commented:
I discovered the answer to this question.  Machine.config exists in two locations:

C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG

I don't understand why there is a 32-bit version of the .NET Framework and a 64-bit version of the .NET Framework present, but IIS7 appears to ignore settings in Framework\v2.0.50727\CONFIG\machine.config.  However, settings in Framework64\v2.0.50727\CONFIG\machine.config are recognized correctly.
Top Expert 2008

Commented:
Hi,

yes - sorry, my mistake - applicationhost.config includes web.config parameters :-}

are you running this under a 64 bit OS?  I don't know why the 32bit version is installed - perhaps the .NET installer loads those for legacy reasons maybe.

Cheers.

Author

Commented:
No worries - and thanks for your posting, anyway.  I am new to Experts Exchange, and already I am beginning to see how valuable it will become to me.

To answer your question: yes, the machine is running a 64-bit version of Windows Server 2008.  I had not noticed the "Framework64" folder, since I have never before used it or had cause to look for it.  I don't understand why both versions of the .NET Framework are installed side-by-side, or if the 32-bit version can be safely removed, so I will need to do some further research on this.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial