Link to home
Start Free TrialLog in
Avatar of GivenRandy
GivenRandy

asked on

GetCommandLineArgs -- Permissions Problem ?

I have a line in some legacy code:

      Dim cmdLineArgs() As String = System.Environment.GetCommandLineArgs()

Earlier, I had been getting this error:

      “Request for the permission of type System.Security.Permissions.EnviormentPermission, mscorlib, Version=1.05000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.”

I had to resort to messageboxes (couldn't add simple file logging at this point). So, now, the messagebox shows before the GetCommandLineArgs, but the messagebox after that line never shows up. Very weird.

By the way, this works on three out of four logons, so I suspect some kind of permissions problem, but don't know what it is.
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of GivenRandy
GivenRandy

ASKER

Yes.
Intranet application?  Is the assembly strong-named?  Do you have any trust set for the application through CASPOL?  Did you set the Intranet to Full Trust through the configuration wizard?

Bob
Oh, geez, it was way simpler than I thought. I had forgotten to compile with Release instead. LOL
See ya :D