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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.NET Security Problem

Status
Not open for further replies.

vvlad

Programmer
May 27, 2002
151
DE
I have written a very simple C# program, that tries to read the file structure of the root directory on the C: drive. I get this error:

-----
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 .Net security policy administration tool.
-----

Can someone help?

Thanks,

vlad
 
Do you use W2K or WinXP ?
Execute C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Bin\Permview.exe your.exe to display the permisions set.

-obislavu-
 
tray with the assert security policy, you need to view the assembly with the permview.exe tool to find the security that it need.
 
I've executed the permview and the results I've got are:

------
minimal permission set:
Not specified

optional permission set:
Not specified

refused permission set:
Not specified
-------

One more thing, I've just noticed that on the server I work on I have .NET, and on my local computer I have .NET 2003. Could that be the reason?

vlad
 
.NET and .NET 2003 could cause this problem. If you cannt sync .NETs then:
1. Did you perview.exe also on the server ?
2. See Settings->Control Panel->Administrative Tool->Microsoft .NET Configuration ; Expand Run Time Security Policy (Machine and User)
3. See Settings->Control Panel->Adminstrative Tool-> Services-> ASP.NET state Sevice -> Log On Tab;

-obislavu-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top