Quick way to enable Visual Studio Permissions using Caspol.exe

I’ve ran into this a few times, where i’ve started building console/windows apps in Visual Studio 2005/2008 and the development machine i’m running on, doesnt have permissions to execute programs from a network share and access (for example) the registry or a sql server. The solution is to tell .net that its ok to let things running from that network share, to access the registry or sql server.

The normal, and proper way to do it is using the .net 2.0 SDK and tell it the paths which are allowed full trusts, however, the .net 2.0 SDK isnt fully installed with VS2k5 or VS2k8, and thus you are stuck.

No more, type in the following, replacing <PATH> with either a drive\directory or a \\share\directory and you’re set.

caspol -m -ag 1 -url <PATH> FullTrust

Update: easy quick way to let your local servers get fulltrust

caspol -m -ag 1 -zone intranet FullTrust

How To Redirect Permanently with PHP


To do a permanent redirection using PHP, for whatever SEO needs you may have, the code is

//Standard 404.php file

//Looking for my tnmailserver?
if(strpos($_SERVER[“REQUEST_URI”], “/Projects/TNMailServer-Full.aspx”) !== FALSE)
header(“HTTP/1.1 301 Moved Permanently”);
header(“Location: /TNMailServer”);

The exit is importantly, especially if you still have other code below this snippet performing other checks, or showing the standard 404 page.