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?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.