Saturday, April 30, 2005

My local project is not fully trusted by the .NET runtime....ZoneStripper to the rescue

I started working on a DotNetNuke site for a local charity this week. I downloaded the latest build and extracted it to my local hard drive, but when I opened it, I got this error:

The project location is not fully trusted by the .NET runtime. This is usually because it is either a network share or mapped to a network share not on the local machine. If the output path is under the project location, your code will not execute as fully trusted and you may receive unexpected security exceptions.

What? My local hard drive shouldn't be trusted. That's probably true, but how does Microsoft know? If you're running Windows XP SP2 on an NTFS partition it tracks the Zone for all files. Since my DNN files were created on another machine, they're flagged as coming from the Internet Zone (ZoneId=3).

You can view the setting in notepad. Enter this at the command prompt: notepad.exe DotNetNuke.sln:Zone.Identifier. It will display a file stream similar to this:

[ZoneTransfer]
ZoneId=3

How do you remove/change this setting? Windows provides an interface to remove this setting in the file properties dialog, but you have to click “Unblock“ for each file. (uhg!).

Luckily there is a free utility named ZoneStripper that will recursively clean all the files in your directory. Check out the readme after downloading the code. It explains what is happening in more detail...if you are interested.

No comments:

Post a Comment