destroyhead
Programmer
Hi,
I have a very very simple code :
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Win32;
namespace test
{
class Program
{
static void Main(string[] args)
{
RegistryKey hklm = Registry.LocalMachine;
RegistryKey hkSoftware = hklm.OpenSubKey("Software");
RegistryKey hkMicrosoft = hklm.OpenSubKey("Microsoft");
}
}
}
This does not work. I have this error related to the OpenSubKey() function :
"Request for the permission of type 'System.Security.Permissions.RegistryPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."
It has been 2 days I am trying to find what is wrong on the Internet and I found nothing.
I am the administrator on my box, I can create Registry Keys and I have given full access to the VS Developer group.
Thanks a lot for any help.
I have a very very simple code :
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Win32;
namespace test
{
class Program
{
static void Main(string[] args)
{
RegistryKey hklm = Registry.LocalMachine;
RegistryKey hkSoftware = hklm.OpenSubKey("Software");
RegistryKey hkMicrosoft = hklm.OpenSubKey("Microsoft");
}
}
}
This does not work. I have this error related to the OpenSubKey() function :
"Request for the permission of type 'System.Security.Permissions.RegistryPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."
It has been 2 days I am trying to find what is wrong on the Internet and I found nothing.
I am the administrator on my box, I can create Registry Keys and I have given full access to the VS Developer group.
Thanks a lot for any help.