Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2007-11-18
5
878 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

Suggested Solutions

Title # Comments Views Activity
Formula for calculating ROI on training 6 49
how to hit button in form and close application from main() 4 21
Easy filter aspnet 2 24
transition to visual .net from vb6 5 37
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

856 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