public async Task AddValueInRegistry() {
await Task.Run(() => {
RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Shashi3\Stage1\Stage3", true);
key.SetValue("Test Key", 2);
key.Close();
});
}
Consider the above method when I run it it creates directory in registry but not data entry.
call AddValueInRegistry
by using one of the following methods:
AddValueInRegistry().Wait();
or
public void async UpperMethod() {
await AddValueInRegistry();
}