Solved

Visual Basic .NET Security Error on Shared or Mapped network drive ?

Posted on 2007-11-18
5
877 Views
Last Modified: 2013-11-07
Visual Basic .NET compiled in Visual Studio 2005.
Using .NET version 2.0.50727.42

When running a Visual Basic compiled application on a Shared network or mapped drive the following security error occurs:

Application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission contact your system administrator, or use the Microsoft .NET Framework Configuration tool.
[ Details ]
<configuration>
  <system.windows.forms.jitDebugging="True"/>
</configuration>

 ...
0
Comment
Question by:siacom
  • 2
  • 2
5 Comments
 
LVL 10

Expert Comment

by:MrClyfar
ID: 20309361
Hi there.

What you are experiencing there is the result of code groups. Basically, when running a .NET app on your computer the runtime uses code groups to work out what permissions the .NET assembly has. In this example you can't run a .NET assembly from a network drive.

To get around this problem, copy the .NET assembly from the shared drive and run it locally on your PC. That would work.

The other way around this is to open up Microsoft .NET Framework 2.0 Configuration (found in Control Panel-Administrative Tools). From there you can control what permissions a .NET must have in order to run on your PC. I'm sorry I can't be of much more help, but if someone else could take the reigns and explain how to configure the code group/policy.

Jas.
0
 

Author Comment

by:siacom
ID: 20309391
I have no problem running the application on a local drive.

Ok, so there no way of running an application on a network mapped drive >?

I wanted to do this for a user, so that he can use the application as I complete it. It would be faster and easier for me to compile it to a network drive..
0
 
LVL 10

Accepted Solution

by:
MrClyfar earned 500 total points
ID: 20309472
Hi again.

You can configure the computer's policy to allow the running of .NET assemblies from a network drive, but I;m unfamiliair with actual process of doing that, sorry about that. All I can do is guide to the possible area where the problem lies i.e. the configuration manager for .NET 2.0.

If you Google for ".NET configuration netowkr drive" then you might get some articles explaining how to do this.

Sorry I can't be of more hlep.
Jas.
0
 

Author Comment

by:siacom
ID: 20309925
ok thanks for your help MrClyfar I'll try Google otherwise I'll do the reverse and map the users local drive as my output folder :)

0
 
LVL 2

Expert Comment

by:andrewneely
ID: 20312501
You can run a dot net app from a network.  The issue is code access security.  There are several work arounds.  First is copy the app to the local drive to run.  I put out applications for our office on our network share, and use a batch file to copy the exe on to the local machine each time it runs.  That way, any updates will be pulled down.

Another solution is to use the dot net configuration utility.  What you would need is to grant the network share "FULL TRUST".  

A third option is to use the CASPOL utility found in the windows\microsoft.net\framework\"version", where Version is the dot net version for which you want to modify the trust settings.

Note that modifying the dot net configuration utility (start-settings-control panel - Administrative tool) and caspol require at least power user access.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

813 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

16 Experts available now in Live!

Get 1:1 Help Now