Can't use Environment.CommandLine

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
 
S

Simon Hart [MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top