I have the following API call in one of the inherited windows forms classes:
Whenever I call this function on the developer machine, I am fine. However, when I call it on the deployment machine, I get the following exception:
"The application attempted to perform an operation not allowed by the security policy. The operation required the SecurityException. To grant this application the required permission please contact your system administrator, or use the Microsoft .NET security policy administration tool."
I prefer not to have to perform some sort of manual security configuration on each of my deployment targets.
Is there a way to address this problem in code through the use of class or member attributes?
Thank you for any pointers!
Code:
[DllImport("user32.dll", CharSet=CharSet.Auto)]
static extern int GetWindowText(HandleRef hnd, StringBuilder str, int intMaximum);
Whenever I call this function on the developer machine, I am fine. However, when I call it on the deployment machine, I get the following exception:
"The application attempted to perform an operation not allowed by the security policy. The operation required the SecurityException. To grant this application the required permission please contact your system administrator, or use the Microsoft .NET security policy administration tool."
I prefer not to have to perform some sort of manual security configuration on each of my deployment targets.
Is there a way to address this problem in code through the use of class or member attributes?
Thank you for any pointers!