Faced a problem. There is a WF, it has a part of the code for storing values in the registry:
using (RegistryKey rk = Registry.CurrentUser.CreateSubKey(@"Software\Test")) { rk.SetValue("language", path); } Similarly, I read the value, at this stage everything is good:
using (RegistryKey rk = Registry.CurrentUser.CreateSubKey(@"Software\Test")) { string path = rk.GetValue("language", "").ToString(); } But I try to read this value from the SERVICE written by me - nothing is present, nothing is read. Tell me, are there any nuances when reading the registry from the service? Where to look for a mistake and what is it?
Registry.CurrentUserand the application and service should run under one user, most likely you don’t. PS WF abbreviation is confusing, write Windows Forms or just an application. - default locale