TAG | IoC
21
Godaddy Hosting – Medium Trust vs Inversion of Control
0 Comments | Posted by Dann in ASP.Net, godaddy
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:
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.
I stumbled across this excellent written / video tutorial with source when starting out in my Prism adventure.
Prism for Silverlight – Silver Bay Labs
I think this is the best starting out example I have found. It still requires a basic understanding of Inversion of Control to figure out what he’s trying to do, but run through it a few times and it all sort of fits together.
After trying for a while to figure out how it all sort of works and what I was actually looking for, I found this page at Sparkling Client – Downloading Prism.
Once you get there, there is a 10 step method on how to use Prism/CAG or whatever you want to call it.
Not intuitive in any way for Microsoft to hide it by giving it different names (Prism == Composite Application Guidance), but I guess that’s life.
I blame Microsoft’s love (or perhaps just programmer’s vanity) of renaming things that already have a name, but I think it got away on them here.
Update: Herding Code, in an interview with Glenn on Prism / CAG, discovered that Prism is the “Cool Name” whereas Composite Application Guidance is the “Serious Important Name”.
Coming soon: A photo viewer app using Prism. I know it’s been done to death, but it’s a good start.
