• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5666
  • Last Modified:

The application attempted to perform an operation not allowed by the security policy

I am having an issue where if I use "SendKeys.Send() function", I receive a security error.  I have tried working around this in the Administrator Tools in the Control Panel, but the issue persists.

The error received is:

"The application attempted to perform an operation not allowed by the security policy. The operation required the SecurityException. To grant this application the permission please contact your system administrator, or use the Microsoft .NET security policy administration tool.

Unable to create Hook."

Any ideas how to resolve the error?
1 Solution
as a quick test.. go to configuration wizard for net 1.1

go to Runtime security policy

select adjust zone security

makes changes for the computer

set my computer to full trust

NEXT then FINISH and try app again

NegafoxAuthor Commented:
Unfortunately, I already tried that in the previously and it did not resolve the issue.  I tried it again though and the same issue persists:

-Opened Control Panel
-Opened Administrative Tools
-Opened Microsoft .NET Framework 1.1 Wizards
-Clicked Adjust .NET Security
-Selected My Computer
-Trust is already set to "Full Trust" on the slidebar
-Selected Local Intranet
-Trust is already set to "Full Trust" on the slidebar
-Clicked Next
-Clicked Finished
NegafoxAuthor Commented:
If the information would be useful, I am developing this application on a work computer.  However, I have Administrative access in case there is something that may need to be changed.
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Hi Negafox,

Can you tell me a little more detail about the code you are writing.

NegafoxAuthor Commented:
1. Create a new application in C#.
2. Drop a button onto the form.
3. Double-click the button to open the onClick() event.
4. Type "SendKeys.Send("{A}");" and compile.

Even this yields the exact same error on my work computer.  However, it works fine on my home computer.
NegafoxAuthor Commented:
The issue is resolved now. It turns out that Cisco Security Agent was running in the background. I had the system administrator disable the program and it resolved the issue.
Thank you for the update, Negafox.  I could only find one or two references to this problem and appreciate the extra details and feedback you gave us here.
PAQed with points refunded (500)

Community Support Moderator
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now