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: 886
  • Last Modified:

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

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
siacom
Asked:
siacom
  • 2
  • 2
1 Solution
 
Jason EvansSenior Software DeveloperCommented:
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
 
siacomAuthor Commented:
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
 
Jason EvansSenior Software DeveloperCommented:
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
 
siacomAuthor Commented:
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
 
andrewneelyCommented:
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

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

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