Solved

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

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This video discusses moving either the default database or any database to a new volume.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 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

9 Experts available now in Live!

Get 1:1 Help Now