Project Folder Not Secure Dialog Box

I need this so often, but every time I forget, how it works (from Visual Studio Help).

Project Folder Not Secure Dialog Box

You attempted to create a project on a UNC path. By default, a UNC path is not a trusted location for a project. Your project may 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.

  • .NET Framework Configuration Tool (Mscorcfg.msc)
  • Code Access Security Policy Tool (Caspol.exe)


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, the All_Code node, and then highlight the LocalIntranet_Zone node.
  3. In the right pane select Add a Child Code Group.
  4. Choose Create a new Codegroup and enter a name for the code group, then click Next.
  5. Choose a Condition Type of URL, then 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.
    Note Make sure to add the asterisk at the end of the path.

  6. Choose Use Existing Permission Set of FullTrust, then click Next.
  7. Click Finish.
  8. Restart Visual Studio.


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

Configuring Security Policy