I am having Windows 7 and IIS 7.5 on my machine.

For my application, I have my config files xxx.config and xxx.db.config
located at C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG

with both being referenced in machine.config as -

<appSettings file="xxx.config"/>
  <connectionStrings configSource="xxx.db.config"/>

There are around 10 connection strings in xxx.db.config file. However, when I try to access connection string using following C# code-


No connection string except the default-

.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true

are being returned :-(

P.S. when working with above setting in another Windows 2003 machine with IIS 6, I am able to see all the connection strings available in xxx.db.config

Can anyone please guide what could be the issue.

Thank you!


Check your site's application pool settings to make sure it's configured for .NET Framework 2.0 and 64 bit mode:

enter image description here

  • yes, I reconfirmed, both these settings are same. – iniki Jan 25 '12 at 10:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.