I am getting a SecurityException (as seen below), even with [assembly: AllowPartiallyTrustedCallers] in my AssemblyInfo.cs.
I am deploying to GoDaddy, which is a medium trust environment, which I don't think StructureMap is set up to run under natively, although the 2.5.3 release notes mention adding the AllowPartiallyTrustedCallers attribute on the assembly level, it doesn't seem to correct the issue.
Is there a code example or something that will point me in the right direction? What am I missing?
I am simulating medium trust locally with the following in my web.config
<system.web>
<trust level="Medium" />
</system.web>
Below is the exception stack.
[SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
System.Security.CodeAccessPermission.Demand() +59
System.IO.Directory.GetCurrentDirectory() +182
System.Reflection.Emit.AssemblyBuilderData..ctor(Assembly assembly, String strAssemblyName, AssemblyBuilderAccess access, String dir) +1698440
System.AppDomain.InternalDefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access, String dir, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions, StackCrawlMark& stackMark, IEnumerable`1 unsafeAssemblyAttributes) +327
System.AppDomain.DefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access) +38
StructureMap.Emitting.DynamicAssembly.Init() +184
StructureMap.Emitting.InstanceBuilderAssembly..ctor(IEnumerable`1 plugins) +141
StructureMap.Graph.PluginCache.createAndStoreBuilders(IEnumerable`1 plugins) +25
StructureMap.Graph.PluginCache.Compile() +125
StructureMap.Container.construct(PluginGraph pluginGraph) +118
StructureMap.Configuration.GraphBuilder..ctor(Registry[] registries, PluginGraph pluginGraph) +190
StructureMap.PluginGraphBuilder.Build() +50
StructureMap.ConfigurationExpression.BuildGraph() +103
StructureMap.ObjectFactory.Initialize(Action`1 action) +102
JonEricksonMVC.Library.Bootstrapper.ConfigureStructureMap() +66
JonEricksonMVC.MvcApplication.Application_Start() +19