Can't use Environment.CommandLine

  • Thread starter Thread starter Dom
  • Start date Start date
D

Dom

I have a program that uses Environment.CommandLine. Works fine. Then
I move the exe to a networked drive so others can use it. Now I get
the message:

System.Security.SecurityException: Request for the permission of type
'System.Security.Permissions.EnvironmentPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
failed.

When I take the CommandLine out, it works.

What is going on? How do I get around it?

Dom
 
You need to escalate your code access security (localintranet code group) to
include code permission Directory Services. Lookup code access security on
MSDN.

You can easily change security configuration by selecting the ".NET
Configuration <ver>" in Administrative Tools under Control Panel.
 
Back
Top