R
Robert A. van Ginkel
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(MethodImplOptions.InternalCall)]
extern private static IntPtr GetInvalidHandle();
private static readonly IntPtr InvalidHandle = GetInvalidHandle();
At runtime I get a Runtime Error called:
An unhandled exception of type 'System.Security.SecurityException' 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(MethodImplOptions.InternalCall)]
extern private static IntPtr GetInvalidHandle();
private static readonly IntPtr InvalidHandle = GetInvalidHandle();
At runtime I get a Runtime Error called:
An unhandled exception of type 'System.Security.SecurityException' occurred
in mydll.dll
Additional information: Security error.
Can you please clarrify the problem?
Regards, Robert