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

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 642
  • Last Modified:

Using Main(Environment.GetCommandLineArgs()) from network drive

I have a program that looks for any comand line switches on the compiled exe.  Everything works fine as long as I run the program from one of my local drives  When I try to run the program from one of my network drives I get the error inside a Microsoft .net framework box that says "Application attempted to perform an operation not allowd by the security policy.  to grant this application the required permission, contact your systm administrator, or use the Microsoft .NET Framework Configuration Tool.  If you click continue, the application will ignore this error and teempt to continue.  If you click quit, the applicaion will close immediately.
Request for the permission of type 'system.security.persmissions.environmentpermission, mscorlib, version=2.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089'

Any help on fixing this problem would be greatly appreciated.
0
rlpjr
Asked:
rlpjr
  • 4
  • 3
1 Solution
 
SStoryCommented:
If the application is not running on the same machine that you are on...which is your case, then you will need to go to Control Panel, Administrative Tools, Microsoft .Net Framework x.x Configuration.

Click Applications
Then to the right, click on Add an Application to Configure

.
0
 
SStoryCommented:
Maybe it would be better to just click on the Runtime Security Policy node
Then in the list in the right pane, click on Increase Assembly Trust, then click OK on the form that appears and browse to the assembly in question.

Anyone who runs your app in this manner from any machine would have to have an admin grant this Code Access Trust.
0
 
rlpjrAuthor Commented:
SStory
I must be doing something wrong because I did what you said in the first comment and it did nothing I am still getting the error.  The second one I really don't understand what you want me to do.  If you could walk me through it a little more maybe I will understand.  Thank you for your help.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
rlpjrAuthor Commented:
SStory
I also noticed that I have several net framework configuration under administration version version 1.1 configuration. Version 1.1 wizard and version 2.0 configuration.  I looked in my program and it says that I am using version 2.0.5.072 but when I go under that one there is no application to click on to add my application.  Any ideas on this?
0
 
SStoryCommented:
Go under the 2.0 version

Highlight MyComputer node...then in the links that appear below, click on
Configure Code Access Security Policy

then under the Runtime Security Policy node
Try Increase Assembly Trust
0
 
rlpjrAuthor Commented:
SStory
I did all that then it comes up with a box that says
"Enter the path or url to a managed assembly to trust"  I chose my .exe form my project but that did not like that so what am I suppose to put in there?  
0
 
grayeCommented:
Here is an article that explains it all... and has examples on how to correct this problem via the control panel or via the command-line tool
http://home.hot.rr.com/graye/Articles/CodeAccessSecurity.htm 
0
 
SStoryCommented:
It has been a while since I have done this.  I did point you to the right tool. It is obviously less than intuitive to use.  The link provided by graye seems to tell you how to get it working.
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now