Showing posts with label Visual Studio. Show all posts
Showing posts with label Visual Studio. Show all posts

Thursday, February 19, 2009

Visual Studio 2008 x64: The Project Location is Not Trusted

Aargh... here's hoping I can save someone else some time on this. I raised a new Windows Server 2008 x64 .NET build machine and loaded up Visual Studio 2008 on there. I then tried to open up a project stored on a network share via a UNC path (\\server\share\my.sln) and got the dreaded "project location is not trusted" dialog.

I started looking for the .NET Framework 2.0 Configuration utility in the Administrative Tools area so I could grant FullTrust to my share. It isn't there. Apparently it used to deploy as part of the .NET Framework 2.0 SDK, but the .NET 3.5 (Windows 2008) SDK no longer includes it. This is a shame because the alternative, CasPol.exe, is harder to work with.

At any rate, I fired up a Windows Server 2008 command shell and ran the following command to trust my network share (for those not familiar with CasPol and its syntax, here is an excellent post):
caspol.exe -m -ag 1.2 -url file://\\server/share/* FullTrust
However, upon opening my project, I was continuing to get prompted that the location was not trusted. Finally I noticed that the Windows Server 2008 command shell was an x64 command shell... and Visual Studio 2008 is a 32-bit (x86) application. You have to set the security policy separately for the appropriate version of the .NET Framework.

I then navigated to the x86 version of caspol (%windir%\Microsoft.NET\Framework\v2.0.50727\caspol.exe), issued the same command... and voila, no more prompting!