Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Security Policy issue...

Status
Not open for further replies.

VisualGuy

Programmer
May 27, 2003
162
US
This is my first VB.NET 2005 application and I'm having an issue with putting the .exe on the network and allowing people to run it. It used to be with Classic VB, this was never an issue.

The error message reads as follows:

"Application attempted to perform and operation not allowed by the security policy. To grant thsi application the required permission, contact your system administrator, or use the Microsoft.NET framework Configuration tool.

If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately.

Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'."

I've tried using the configuration tool, but it did'nt work and frankly, I don't want to go around to every PC to set this up anyway. Isn't there a way to complile the application so that anyone can run it? If not, what is the simplist solution here?
 
Possibly. Since no one else has answered let me try to point you in a direction. .NET tries to cut down in possibilities in malicious code being ran. So it runs code based on it trusted level. Code access security or something like that. So you would need to set the codes permission level.

Here is your problem. I can't even begin to tell you how to set the security level. That "System.Security.Permissions.SecurityPermission" is the namespace used for reading/setting the security permissions. As far as the little I know your best option is to set that your network is a trusted site in the configuration tool. That way you don't have to set permissions for each project.

I hope that can at least point you in a direction. The information I was given on the whole subject was really spotty.

-I hate Microsoft!
-Forever and always forward.
 
Another possibility - which I don't actually recommend, but I think you should know about - is to turn off code access security entirely. You can do this by running this at the command prompt:

caspol -s off

Note that you need Administrator privileges for this to work.



I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
caspol -s off works, but it is temporary. The moment you hit enter, the lock is back on. I belive the answer lies in Microsoft .NET Framework 2.0 Configuration tool.

The problem is that I had someone download the .NET V2.0 framework and this configuration tool didn't appear. They still have the Microsoft .NET Framework 1.1 Configuration tool. Me, I have both.

Is there a location on the net where this can be obtained?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top