Solved

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

Posted on 2008-10-28
8
633 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
 

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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

For many of us, the  holiday season kindles the natural urge to give back to our friends, family members and communities. While it's easy for friends to notice the impact of such deeds, understanding the contributions of businesses and enterprises i…
Most of the applications these days are on Cloud. Cloud is ubiquitous with many service providers in the market. Since it has many benefits such as cost reduction, software updates, remote access, disaster recovery and much more.
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

929 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now