Code Access Security Policy (CASPOL.exe) GUI Utility

I find it extraordinarily difficult (okay… inconvenient?) to make Code Access Security Policy changes in the .NET Framework. After .NET 2.0, outside of the SDK, the graphical tools for doing this were no longer installed on most client PC’s. Usually, when I have to break out caspol.exe, it’s possibly because:

  1. I downloaded a third party DLL from a web site, and it’s not trusted, with no unblock option, and Visual Studio is complaining about it when I’m actually trying to get some real work done
  2. I want to run some .NET apps off a network share, and the machine I’m using doesn’t have .NET 3.5 SP1.

… and it’s used so infrequently that I have to look up all the command line options and re-learn the thing every time, not to mention when I finally get the command right, I’m not in Elevated Privileges mode (Vista / Win 7).

So, for those like me, who like GUIs, and just want to get an assembly or folder trusted and move on with life, I present to you – a GUI CASPOL command generator:

image

This supports a subset of the available CASPOL commands:

  • Single file / assembly
  • Folder path / network share
  • Different scopes (Machine / User / Enterprise)
  • Trust Level (FullTrust by default)
  • Code Groups
  • Run CASPOL command in Elevated mode

For the small executable – Download It Here (9K)

… or, here’s the source project (VS2008 / C#).

About these ads

19 thoughts on “Code Access Security Policy (CASPOL.exe) GUI Utility

  1. Turker Tunali

    Great utility. Even if user doesn’t have administrative rights, log in/password screen shows up. It has many parameters and also shows generated “caspol.exe” parameters.

    Reply
  2. Lynn Huff

    Why couldn’t the jack wagons at MS have just provided this tool? Some of us need things like this on RARE ocassions. And because its RARE, we can’t be expected to remember all of the commands. We shouldn’t have to wade through pages of switch descriptions to figure out how to execute one line of code!!

    THANK YOU! THANK YOU!

    Reply
  3. CheesyPeteza

    When browsing for a folder I only had the option to look under My Computer, not My Network Places. I need to select a full UNC path to a network share so this is a problem.

    I could copy and paste it manually, but then why use this tool? The idea for me anyway is to take out the human error from manually putting together the command.

    Reply
    1. Brandon Post author

      @CheesyPeteza, if you can already copy and paste it manually and would save you more time than using the tool, then by all means, do what’s best for you. However, if you want to customize it to fit your particular need, the source code is posted at the bottom of the post. :)

      Reply
  4. CheesyPeteza

    No problem I will alter it, I just thought you might want to change it for others.

    I’ll be mainly giving this to others to use and I don’t like to say, here use this, oh btw you can’t … so you have to …

    I prefer, here use this.

    Reply
  5. dan

    Thank you SO MUCH. You just saved me some time. Time that I can enjoy, rather than time figuring out how to properly use caspol.exe. Microsoft should provide a GUI just like this. Instant Karma coming your way.

    Reply
  6. Pingback: Excel Add-in Not loading (A runtime error occurred)

  7. Pingback: Is there a CASPOL.exe GUI command line generator? | Zedian Answers

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s