Author: eFlare | Posted on: 10/14/2009 5:46:02 AM | Views : 295

Here's a question.
I have a website that has some information (like common used file paths and other config stuff that most of my websites share) in the Windows registry of my server. It's under HKEY_LOCAL_MACHINE\Software\CompanyHosting\CommonConfig\ . Obviously the last two names are made up by myself.
Now, everything works dandy on my own machine and on my testing server (Windows Server 2003) but, when I try to read from the registry, in ASP.NET, on my production server (Windows Server 2008) everything goes wrong. The OpenSubKey method simply returns null for everything.
This is the code i am using (to test):


RegistryKey key = Registry.LocalMachine.OpenSubKey("Software\\CompanyHosting\\CommonConfig"); if (key != null) { string value = key.GetValue("DefaultEntryLevel", "<null>").ToString(); ...

Go to the complete details ...