When opening a project on a network drive either Novell or Microsoft you get this message.
"This Project location not fully trusted by .NET Framework..."
If you request help, the document simply tells you how to set it up correctly, but if you are doing local network development then you have to pick the local intranet zone to allow "All Code" and "Fully Trusted". The only easy solution at the moment resides below.
Visual Basic and Visual C# Reference
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)
Mscorcfg.msc (The .NET Framework Configuration management console)
The simplest way to modify the policy affecting a file share is to give a specific file share FullTrust permission using mscorcfg.msc. Administrator rights are required on the computer to make this change.
To give a file share FullTrust permission:
- Start mscorcfg.msc.
- Expand the Runtime Security Policy node, then expand the Machine node, then expand the Code Groups node, then expand the All_Code node, and then highlight the LocalIntranet_Zone node.
- In the right pane select Add a new child code group to this code group.
- Choose Create a new Codegroup, give it a reasonable name for the share then click Next.
- I used Shateiel Storage Tutor
corresponds to my server name, the share, and the folder
- Choose a Condition Type of URL
URL can mean http, ftp, or file share
- then add the .NET Framework SDK to the share location of your project. Click Next.
I used //SHATEIEL/STORAGE/Tutor/*
This was changed to file://SHATEIEL/STORAGE/Tutor/*
This corresponded to the Server name
followed by the share
followed by the folder
and lastly a wildcard * was used to allow all assemblies under this location
If you have to get more specific you can do so
- Choose Use Existing Permission Set of FullTrust. Click Next.
For added security you could create your own customized permission set
To keep my intranet on an even keel with my computer I chose FullTrust
- Click Finish.
- Some documents claim that you need to restart Visual Studio
Sometimes you do
Sometimes it just works straight away.
- You may now run your project on a intranet UNC
Caspol.exe
Using caspol.exe to accomplish this change, you would use the following command line, you must have administrator rights on the machine to make this change.
caspol -m -ag 1.2 -url urlname FullTrust