Godaddy Hosting – Medium Trust vs Inversion of Control

Whatever I think of Godaddy, they haven’t caused me too much pain yet, just minor inconvenience. This time it’s my precious StructureMap.

StructureMap, I like it and alot of people do, but it just won’t work under Medium Trust! So it’s either time to change Hosts, or change IoC container. Pretty obvious which one is the easier choice here.

So what choice do you have? Well not much. So the answer is:

Unity from Microsoft Patterns & Practices*

Here’s a nice manual to go with it.

And what’s not able to be run in medium / partial trust:

Windsor Castle
Spring.Net
StructureMap

There was someone who was explaining how to download and build Spring.Net to allow it to run under Medium Trust, but that seems pretty likely to cause issues when you hack code (try to ignore my NHibernate post when I say that).

It may be the same for the other 2, but off the bat, Unity wins.

*Caveat: Unity is restricted in what it can do when run without ReflectionPermission (which is what Medium Trust disallows), but typically this won’t affect much from the normal IoC behaviour.  The restrictions are explained on this MSDN doc, but it’s to do with internal and private constructors and properties. If it’s public you should be sweet.

This entry was posted in ASP.Net, godaddy and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>