Configuring .NET 2.0 security

I made a rather annoying discovery today: the .NET framework 2.0 redistributable doesn't come with the configuration tool. Versions 1.0 and 1.1 both included the mscorcfg.msc configuration panel that allowed you to do things like change the security settings on assemblies and zones. But not version 2.0. If you want that, you have to install the .NET 2.0 SDK. This makes no sense to me, but that's the way they did it.

Fortunately, this isn't a deal-breaker, because the .NET framework does come with a command-line utility named caspol.exe, which allows you to change the .NET security policies. Unfortunately, the syntax used by caspol isn't exactly obvious. In fact, it's kind of obscure, especially if you just want to do a quick security boost on a perticular zone.

Luckily, a Google search brought up the exact command I needed:
caspol -machine -chggroup LocalIntranet_Zone FullTrust
This one simply elevates the Intranet zone to full trust. That allows my program to do little things like read it's configuration file from the network share directory. It's kind of hard to query the database when you can't read the file with the connection string and SQL statements.

You can reply to this entry by leaving a comment below. You can send TrackBack pings to this URL. This entry accepts Pingbacks from other blogs. You can follow comments on this entry by subscribing to the RSS feed.

Add your comments #

A comment body is required. No HTML code allowed. URLs starting with http:// or ftp:// will be automatically converted to hyperlinks.