Editing and running .NET projects from network resources

Since I run my stuff in a virtual machine, I like to save my data on host shares. But then running and debugging (web applications) and tests from Visual Studio have problems. How to configure everything to work with FullTrust when launched in Visual Studio?

Or how easy is it to set up full trust for all network drives?

I disabled UAC.

+2
security visual-studio full-trust
source share
3 answers

You will need to use the command line command caspol.

Open a console window and enter the following command:

caspol -machine -addgroup <group_param> -url file://yournetworkdriveletter/* FullTrust -name somename 

Note. group_param is the group to which you want to add a new zone, which will be the "Local Intranet". You can run caspol -lg to find out what zone number of the local intranet is on your system.

On my system it's 1.2

So, the command you have to execute is:

 caspol -machine -addgroup 1.2 -url file://driveletter/* FullTrust -name MyNewZoneName 
+2
source share

I'm not sure why, but using caspol with the -url option did not work for me (perhaps because subdirectories are not included).

My setup is a Windows XP guest machine inside VirtualBox, with .net 2.0 executables running from shared folders. This is a command that allows them to run:

 C:\Windows\Microsoft.NET\Framework\v2.0.50727\caspol -ag 1 -allcode FullTrust 



BTW. If you want to use reset permissions for .NET defaults, use caspol -reset .

+1
source share

What version of the framework are you using?

You can use "caspol.exe" to provide additional trust for the shares you specify, but with .NET 3.5 SP1 installed, network resources receive the same trust: see here :

Managed applications that are open from network shares have the same behavior as native applications with full trust.

I cannot remember whether this applies equally to the mapped shares (F :) and UNC shares (\\ myserver \ someshare), but it would be easy to check.

You may also consider ClickOnce, which is the IMO the easiest way to deploy full .NET applications on the web / web.

0
source share

All Articles