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.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
That is because after the exception, you won't reach the next line.

Is this running from a network path?


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GivenRandyAuthor Commented:
Bob LearnedCommented:
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?

GivenRandyAuthor Commented:
Oh, geez, it was way simpler than I thought. I had forgotten to compile with Release instead. LOL
Bob LearnedCommented:
See ya :D
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.