Posted By: Arran | Nov 10th, 2005 @ 1:44 AM
page 1 of 1
Comments: 3 | Views: 5252
Hi, right...i am having major problems with CAS policy with .net 2.

First off you need to install the SDK if you want to access the GUI tool for changing a servers CASPOL settings.

Once i have got that done i grant my assebmly (which is being used in a web site as a HTTPHandler) full trust.  This stops the error message which says "Assembly or one of its dependancies failed to request the required security permission" to a error message which says

"Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."

The problem is my assembly has no dependancies (other than mscorlib) and has been grated full permission.  Yet i still get this AspNetHostingPermission error.

Any ideas anyone?
I keep seeing reference to a caspol GUI and it always says 'install the SDK'.....which SDK are you referring to?
JohnAskew
JohnAskew
9 girl in pink sweater

Shawnfa's blog is the best online resource I've found for .NET Security.

http://blogs.msdn.com/shawnfa/

A little of the main topic, but I think it's interesting anyhow. I came accross the fact that CasPol (and some of the other tools) are now only included in the SDK just about the time where I was on a remote server and wanted to change the CAS level on my assembly. After a little anger rage I and a lot of Live'ing (ok, it just doesn't sound as cool as Googling, and it was Google) I came accross a utility that has saved me a lot of work since that day.

It so happens Aaron Stebner put together a WiX Script that puts together all (or at least most) of the missing tools from the SDK and builds a neat little MSI Packet that you can install. But beware, it if (of course) unsupported and not recommended for any production servers due to security patching and so on... (But if you don't want to install the full SDK you are quite quickly tempted by the MSI.)

I have the MSI with me on a USB Stick and you can build your own in no time. See here how to do it. Have fun!
page 1 of 1
Comments: 3 | Views: 5252