Reading from the Registry in ASP.NET

Posted by Filip Ekberg on Stack Overflow See other posts from Stack Overflow or by Filip Ekberg
Published on 2010-04-28T12:21:28Z Indexed on 2010/04/28 12:23 UTC
Read the original article Hit count: 335

Filed under:
|

I have a Library ( DLL ) that has a method with the following:

var masterKey =      
    Registry.
    LocalMachine.
    OpenSubKey("SOFTWARE\\Microsoft\\Dynamics\\5.0\\");

When running this method in an WinForms applicaiton, masterKey is not null and when running this in asp.net masterKey is null!

I've checked the executing user with WindowsIdentity.GetCurrent().Name and the same user is executing both applications. The asp.net application is executed in visual studio ( debug: F5 ) and so is the WinForms application.

How come I cannot read the key in asp.net?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about c#