5 out of 8 rated this helpful - Rate this topic

The Project Location is Not Trusted Dialog Box

The Project Location is Not Trusted dialog box appears if you open a project that has been downloaded from the internet, or if you try to create a new client project or open an existing project by using a Universal Naming Convention (UNC) path. To prevent the dialog box from appearing for a project that has been downloaded from the internet, unblock the .zip file before you extract the project. For more information, see How to: Use An Assembly from the Web in Visual Studio (The page is about assemblies, but the unblocking procedure is the same for .zip files.)

By default, a UNC path is not a trusted location for a project. You can modify the security policy of the file share to prevent this dialog box from appearing. For more information, see Configuring Security Policy.

The following tools can be used to modify the policy affecting the file share:

The .NET Framework Configuration tool (Mscorcfg.msc) is a Microsoft Management Console (MMC) snap-in that enables you to manage and configure assemblies in the global assembly cache, adjust code access security policy, and adjust remoting services. One simple way to modify the policy affecting a file share is to give a specific file share FullTrust permission using the Mscorcfg.msc tool. You must be an administrator on the computer to make this change.

If you want to manage .NET Framework 2.0 and later versions by using the configuration tool, you must install the .NET Framework 2.0 SDK.

Note Note:

The .NET Framework versions 3.0 and 3.5 are built incrementally on the .NET Framework version 2.0. The configuration tool included in the .NET Framework 2.0 SDK is the latest version of the tool. You can use this version to manage code access security policy for the .NET Framework 3.0, 3.5, and later versions also.

You can run the Mscorcfg.msc from the following locations:

  • The Start menu

  • The command line

  • The Microsoft Management Console

For information about how to run the Mscorcfg.msc tool, see .NET Framework Configuration Tool (Mscorcfg.msc).

The CAS Policy tool (Caspol.exe) enables users and administrators to modify security policy for the computer policy level, the user policy level, and the enterprise policy level. The best way to run the Caspol.exe tool is from the Visual Studio command prompt. You must be an administrator on the computer to make security policy changes.

To run the Caspol.exe tool

  • From the Visual Studio command prompt, enter the following command:

    caspol -m -ag 1.2 -url urlname FullTrust
    

For more information about how to use the Caspol.exe tool, see Configuring Permission Sets Using Caspol.exe.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Not working for me
I am also running Windows 7 and Visual Studio 2008 (Visual Basic), but this solution does not work for me.  I still get the warning about the location being untrusted.  When I create a project and debug it, it will work the first time.  If I make any changes and debug it again, it will run the original version, no matter what changes are made.  I have to exit Visual Studio, delete the bin folder and open the project again to recompile it.  Clearly this is not acceptable.  I am a teacher using this in a classroom.  We cannot store the projects on the local drive because it is protected by DeepFreeze.  Students have to store their work on their network drive, so projects have to be able to compile and run from the network drive.
Any suggestions would be very welcome!!
Unfortunately I will have to switch away from Visual Basic if this cannot be solved.
- Kevin
UrlName clarification
Several people have had an issue with the above command due to using the wrong urlname for a unc path. The urlname in the command above should be of the form file://\\uncpath e.g. to grant full trust to all shares on MyNetworkShareHost ,

%windir%\Microsoft.NET\Framework\v2.0.50727\CasPol.exe -m -ag 1.2 -url "file://\\MyNetworkShareHost\*" FullTrust

The above was tested on Windows 7 w/ Visual Studio 2008 .
Same warning appears for downloaded content on Vista and later
http://www.cjcraft.com/Blog/2007/09/02/TheProjectLocationIsNotTrusted.aspx

To fix this, unblock (File Properties->General->Unblock) the zip file before you extract.