Search code examples
c#.netwindowswinformsgac

Windows Program > The Zone of the assembly that failed was: MyComputer


I'm written a Windows Form Application based on .NET Framework 3.5 SP1 and it's running on windows server 2003 edition. I tried to add another user to use this program and got the following error

The Zone of the assembly that failed was: MyComputer



2012-04-11 13:30:43,326 [1] ERROR UclUserLogin - [btnSubmit_Click] The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception. 
System.TypeInitializationException: 
The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception. --->               
System.TypeInitializationException: The type initializer for 'Oracle.DataAccess.Client.RegAndConfigRdr' threw an exception. --->   
System.Security.SecurityException: Requested registry access is not allowed.
at System.ThrowHelper.ThrowSecurityException(ExceptionResource resource)
at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)
at Microsoft.Win32.RegistryKey.OpenSubKey(String name)
at Oracle.DataAccess.Client.RegAndConfigRdr..cctor()
The Zone of the assembly that failed was:
MyComputer
--- End of inner exception stack trace ---
at Oracle.DataAccess.Client.RegAndConfigRdr.ReadEntriesForRegistryAndConfig()
at Oracle.DataAccess.Client.OracleInit.Initialize()
at Oracle.DataAccess.Client.OracleConnection..cctor()
--- End of inner exception stack trace ---
at Oracle.DataAccess.Client.OracleConnection..ctor(String connectionString)

Solution

  • The Oracle client can not access some register key due to the user have not full control rights to them.

    What you need to Using regedit, navigate to the registery key and right click on the folder with the above name. Then select permissions and you can change permissions there per user.

    A possible key is

    `HKLM/Software/Policies/Microsoft/Windows/Installer`
    

    If you can not find the correct key , your can use process monitor to check what extactly it is.

    process monitor can be download Microsoft