April 2006 - Posts

BloggingAbout .Net meeting?

I've been thinking: would there be any interest for a bloggingabout .net meeting among the bloggers? We are all into .Net and most of us seem to enjoy a good discussion. Maybe we can organize a platform for those discussions in real life in stead of through posts and comments. It could be about anything, but has to have a predefined agenda to make sure the meeting has a goal.

Of course you don't do this kind of thing every week, but it might be interesting to share thoughts and ideas in real life now and then, and about something more than only the things we happen to blog about. I understand there are already lots of groups and meetings, and it might not have a lot extra to offer, but maybe there are more of you who could be interested in attending such a meeting?

It's just something I wondered about. I'm looking forward to seeing your reactions.....

Posted by Rick van den Bosch | 11 comment(s)
Filed under: ,

SecurityException: That assembly does not allow partially trusted callers.

The exception mentioned in the title of this post was the one I encountered when using an ASP.Net control I had written.

How I encountered the exception:
Because I develop several websites, there's a lot of functionality I need more than once. A possible solution for this is to write a control gallery containing the functionality I needed. And putting them in a seperate assembly makes it easy to dstribute them freely in the near future ;). I made the assembly (containing an image gallery and a download gallery) and used it in a website I am developing together with a good friend of mine. There were no problems and life seemed good. Until the day came we published the website. After putting the website online, one of the pages was not rendering correctly, displaying the message "Unhandled Exception: System.Security.SecurityException: That assembly does not allow partially trusted callers".

The reason for the exception:
Lots of providers don't run websites in Full Trust mode. Because of that some actions you can take inside a (referenced) assembly aren't allowed. For me I'm not sure if the problem was the scanning of the hard drive or the fact I get embedded images from the assembly. One way or the other: there was stuff in there which wasn't allowed ;).

Taking care of the exeption:
The solution I used to solve this problem was pretty straight-forward: I added the AllowPartiallyTrustedCallersAttribute to the assembly. Another solution could have been to extract the controls from the seperate assembly and put them inside the website, but I didn't prefer that. This article on the .Net security blog explains a bit more about the AllowPartiallyTrustedCallersAttribute...

Posted by Rick van den Bosch | 13 comment(s)
Filed under: