Solved

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

Posted on 2008-10-28
8
634 Views
Last Modified: 2012-05-05
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
Comment
Question by:rlpjr
  • 4
  • 3
8 Comments
 
LVL 25

Expert Comment

by:SStory
ID: 22826379
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
 
LVL 25

Expert Comment

by:SStory
ID: 22826439
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
 

Author Comment

by:rlpjr
ID: 22831505
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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

Author Comment

by:rlpjr
ID: 22831592
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
 
LVL 25

Expert Comment

by:SStory
ID: 22834064
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
 

Author Comment

by:rlpjr
ID: 22835087
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
 
LVL 41

Accepted Solution

by:
graye earned 500 total points
ID: 22840290
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
 
LVL 25

Expert Comment

by:SStory
ID: 22840413
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
2 Subnets, 2 routes, failover routing ? 3 41
get row value in vb.net 4 14
Setting up static routes to  sonicwll 4 35
VB.NET 2008 - SQL Timeout 9 24
If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

770 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