I have a strange C# problem. Is the following a bug? Because it should be
possible to run unsafe code. How can I accomplish this? And where can I read
more about this, because documentation on this is rare.
I have a project where i need to use some internal calls. In this project I
have 'Allow unsafe code blocks' set to true.
And in my class i have:
[MethodImpl(Meth odImplOptions.I nternalCall)]
extern private static IntPtr GetInvalidHandl e();
private static readonly IntPtr InvalidHandle = GetInvalidHandl e();
At runtime I get a Runtime Error called:
An unhandled exception of type 'System.Securit y.SecurityExcep tion' occurred
in mydll.dll
Additional information: Security error.
Can you please clarrify the problem?
Regards, Robert
possible to run unsafe code. How can I accomplish this? And where can I read
more about this, because documentation on this is rare.
I have a project where i need to use some internal calls. In this project I
have 'Allow unsafe code blocks' set to true.
And in my class i have:
[MethodImpl(Meth odImplOptions.I nternalCall)]
extern private static IntPtr GetInvalidHandl e();
private static readonly IntPtr InvalidHandle = GetInvalidHandl e();
At runtime I get a Runtime Error called:
An unhandled exception of type 'System.Securit y.SecurityExcep tion' occurred
in mydll.dll
Additional information: Security error.
Can you please clarrify the problem?
Regards, Robert
Comment