• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5640
  • 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?
0
Negafox
Asked:
Negafox
1 Solution
 
topdog770Commented:
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





0
 
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
0
 
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.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
findsukeshCommented:
Hi Negafox,

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

Regards,
Sukesh.
0
 
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.
0
 
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.
0
 
topdog770Commented:
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.
0
 
GranModCommented:
PAQed with points refunded (500)

GranMod
Community Support Moderator
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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