views:

88

answers:

2

Since I run my stuff in a VM I like to save my data on shares on the host. But then running and debugging (web) applications and tests from within Visual Studio has problems. How can I configure everything to run with FullTrust when it's started in Visual Studio?

Or how to just configure full trust for all network drives?

I have turned off UAC.

+1  A: 

You'll have to use the caspol command-line command.

Open up a console-window, and type this command:

caspol -machine -addgroup <parentnr_to_where you want to add group> -url file://yournetworkdriveletter/* FullTrust -name somename

Note: the parentnr of the group to which you want to add your new zone, will be 'Local Intranet'. You can execute caspol -lg to see what the number of the local-intranet zone is on your system. On my system, it is 1.2

So, the command you've to execute is:

caspol -machine -addgroup 1.2 -url file://driveletter/* FullTrust -name MyNewZoneName
Frederik Gheysels
A: 

What version of the framework are you using?

You can use "caspol.exe" to provide extra trust for shares that you specify, but with .NET 3.5 SP1 installed, network shares get the same trust anyway: see here:

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

I can't remember whether that applies equally to mapped shares (F:) and UNC shares (\\myserver\someshare), but it would be easy to test.

You could also consider ClickOnce, which is IMO the easiest way to deploy full .NET applications to network / web locations.

Marc Gravell