Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

GetCommandLineArgs -- Permissions Problem ?

Posted on 2006-03-27
5
Medium Priority
?
391 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.
0
Comment
Question by:GivenRandy
  • 3
  • 2
5 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 2000 total points
ID: 16306939
That is because after the exception, you won't reach the next line.

Is this running from a network path?

Bob
0
 
LVL 9

Author Comment

by:GivenRandy
ID: 16306987
Yes.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16309761
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
0
 
LVL 9

Author Comment

by:GivenRandy
ID: 16322068
Oh, geez, it was way simpler than I thought. I had forgotten to compile with Release instead. LOL
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16323270
See ya :D
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Integration Management Part 2
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question