Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2005
Visual Studio
 The Project Location is Not Trusted...
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
Visual Web Developer 
The Project Location is Not Trusted Dialog Box 

This dialog box appears if you attempt to open or create a client project on a Universal Naming Convention (UNC) path. By default, a UNC path is not a trusted location for a project. Your project might not run correctly when you attempt to debug or run from this location. For more information, see Configuring Security Policy.

The following tools modify the policy affecting the file share:

Mscorcfg.msc

One simple way to modify the policy affecting a file share is to give a specific file share FullTrust permission using Mscorcfg.msc. You must be an administrator on the computer to make this change.

To give a file share FullTrust permission
  1. Start Mscorcfg.msc.

  2. Expand the Runtime Security Policy node, the Machine node, the Code Groups node, and the All_Code node, and then highlight the LocalIntranet_Zone node.

  3. In the right pane, click Add a Child Code Group.

  4. Choose Create a new code group, enter a name for the code group, and then click Next.

  5. Choose a condition type of URL, and enter the UNC path to the share location of your project, using the format file://\\servername\sharename\* where \\servername\sharename is the name of the share. Click Next.

    NoteNote

    Make sure to add the asterisk at the end of the path.

  6. Choose Use existing permission set and select FullTrust, and then click Next.

  7. Click Finish.

  8. Restart Visual Studio.

Caspol.exe

Using caspol.exe to accomplish this change, you would use the following command line (you must be an administrator on the computer to make this change.):

caspol -m -ag 1.2 -url urlname FullTrust

See Also

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Trust issues may be cause by ZIP files      PeterWone ... EricTN   |   Edit   |   Show History

When the untrusted project location is on a local file path this usually means the files and folders were extracted from an untrusted ZIP file. Right-click on the ZIP file and choose Properties to obtain the Properties dialog. If you see an Unblock button enabled then this is the cause of your troubles. Click the Unblock button. Delete the files and folders you previously extracted and any copies you made (which will also exhibit the problem) and repeat the extraction and copying process. You should find the problem is resolved.

12/09/2007 - I just wanted to concur, this problem happened to me when I tried to load a solution from the Beta 3 Entity Samples (http://www.codeplex.com/adonetsamples/Release/ProjectReleases.aspx?ReleaseId=8858) that I had extracted from the zip file onto a Vista machine. The instructions above solved the issue.

Tags What's this?: Add a tag
Flag as ContentBug
Looks like making this change at the 'user' level does *not* work      RoyPardee   |   Edit   |   Show History
Just FYI--I tried adding a code group at the user level rather than machine w/the proper membership condition & it looks like it did not have the desired effect. So you really do have to do it at 'machine' level.
Tags What's this?: Add a tag
Flag as ContentBug
Does not seem to work for DFS Shares      TedSA   |   Edit   |   Show History
This doesn't appear to work when the share is referenced through the Distributed File System unless the DFS root is included in machine's Intranet zone.

Also it seems that if .Net 2.0 is installed side by side with .Net 1.1, the configuration must be done using the .Net 2.0 tools.
Need to mention that a Visual studio of Framework specific prompt needs to be opened.      Tatworth   |   Edit   |   Show History

Since the CASPOL and MSCORCFG.MSC are framework specific, it is necessary to open either a visual studio of framework specific prompt. The documentation should include this.

Tags What's this?: Add a tag
Flag as ContentBug
When 2 or more version of Visual Studio installed      ShiatsuPete   |   Edit   |   Show History

I just wanted to clarify Tatworths comments - thanks for them, as that helped me find the solution, but it still took a while to get there.

I have VS2003 & 2008 installed on the same machine, when I tried opening MSCORCFG.MSC, caspol.exe, or using the .net config tools in Admin Tools I always got version 1.1 tools without knowing, and still got an error with VS2008. What I eventually realised was that I needed to open command prompt, and then run vsvars32.bat from the c:|Program Files\Visual Studio\Common7\Tools Folders specific to the version of VS that I had the problem with.

After that running Caspol.exe sorted out my permissions.

Hope that helps

Tags What's this?: Add a tag
Flag as ContentBug
Problems with Local Network Drives      Rick Henderson   |   Edit   |   Show History
This problem has bugged me for 3 years now and I've finally fixed it thanks to this article. However, I wasn't specifically using a UNC share, just a local network drive mapped to a drive letter.

I chose "All Code" as the Membership condition and "Full Trust" as the permission set. It fixed my problem.

Is there a safer set of settings I should try using? Also, I spoke with someone who "changed the security settings" and didn't have this problem anymore... but can't remember what he did. Is there a setting in Visual Studio 2008 to fix this?

Does this also mean that if I simply add "file://x:/" as a trusted site in Internet Explorer I can get a similar solution?


This stuff saddens me...      JanBannister   |   Edit   |   Show History
I love .net but this kind of ill-conceived security system will kill .net desktop applications on windows pretty soon. The hackers who know how to get round your previous terrible security implementations know how to get round this stuff too. All you're doing is making it harder for people to develop and deploy software for your platform. Why not fix the buffer overflows all over your kernel first?

Your security team needs some 'pruning'!

Tags What's this?: Add a tag
Flag as ContentBug
RE: Trust issues may be cause by ZIP files      DanGlass   |   Edit   |   Show History
The issue is the unzipped data needs to be removed from the untrusted zone.

Sysinternals has a utility called streams.exe to remove the untrusted zone recursively.

http://intellects.in/2008/11/06/utility-to-recursively-unblock-files-downloaded-from-internet/

Using file://.host/Shared Folders under VMWARE from Visual Studio      Keith Dorken   |   Edit   |   Show History
See http://www.gnegg.ch/2008/04/vmware-shared-folders-and-visual-studio/
for information on getting around problems trying to use Visual Studio in a VM (VM Fusion under MACOS) accessing the files using \\.host\Shared Folders\userfiles

Seems Microsoft treats the UNC name \\.host as an INTERNET reference and not a INTRANET reference.

Furthermore, Visual Studio will not PARSE \\.host because of the '.'; you need to use another drive name or share the folders using a different UNC name.

How I wish the world could adopt consistent rules for UNCs
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker