I am trying to over hand a RegistryKey to a class in my dll. Reading the Key into an temporary Key works(checked in debugger), but a NullReferenceException gets thrown when i try to assign it to the target RegistryKey-variable in that static class.
The following code is executed in the Constructor of the MainWindow (WPF-application)
try {
RegistryKey tK;
tK = Registry.ClassesRoot.OpenSubKey("Software").OpenSubKey("Software Untergrund");
Options.SU = tK; //<= NullRefenceException gets thrown here
} catch (NullReferenceException e) {
Console.WriteLine(e.StackTrace);
throw;
}
Thanks for help in advance.