We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

GetCommandLineArgs -- Permissions Problem ?

GivenRandy
GivenRandy asked
on
Medium Priority
405 Views
Last Modified: 2008-02-26
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.
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2008
Commented:
That is because after the exception, you won't reach the next line.

Is this running from a network path?

Bob

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Yes.
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2008

Commented:
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

Author

Commented:
Oh, geez, it was way simpler than I thought. I had forgotten to compile with Release instead. LOL
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2008

Commented:
See ya :D
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.