I recently upgraded a server from 6.0.2 to 7.3.3. The site is running on Rackspace (IIS7, Asp.net 4.0, MSSQL 2012). After upgrading when I try to login to the site I receive the following exception :
DotNetNuke.Services.Exceptions.PageLoadException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'System.ComponentModel.Composition.MetadataViewGenerator' threw an exception. ---> System.Security.SecurityException: Request failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessSecurityEngine.Check(PermissionSet permSet, StackCrawlMark& stackMark)
at System.Security.PermissionSet.Demand()
at System.Security.CodeAccessSecurityEngine.CheckGrantSetHelper(PermissionSet grantSet)
at System.Reflection.Emit.AssemblyBuilder.nCreateDynamicAssembly(AppDomain domain, AssemblyName name, Evidence identity, StackCrawlMark& stackMark, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions, Byte[] securityRulesBlob, Byte[] aptcaBlob, AssemblyBuilderAccess access, DynamicAssemblyFlags flags, SecurityContextSource securityContextSource)
at System.Reflection.Emit.AssemblyBuilder..ctor(AppDomain domain, AssemblyName name, AssemblyBuilderAccess access, String dir, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions, StackCrawlMark& stackMark, IEnumerable`1 unsafeAssemblyAttributes, SecurityContextSource securityContextSource)
at System.Reflection.Emit.AssemblyBuilder.InternalDefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access, String dir, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions, StackCrawlMark& stackMark, IEnumerable`1 unsafeAssemblyAttributes, SecurityContextSource securityContextSource)
at System.AppDomain.InternalDefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access, String dir, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions, StackCrawlMark& stackMark, IEnumerable`1 assemblyAttributes, SecurityContextSource securityContextSource)
at System.AppDomain.DefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access)
at System.ComponentModel.Composition.MetadataViewGenerator..cctor()
--- End of inner exception stack trace ---
at System.ComponentModel.Composition.MetadataViewGenerator.GenerateView(Type viewType)
at System.ComponentModel.Composition.MetadataViewProvider.GetMetadataView[TMetadataView](IDictionary`2 metadata)
at System.ComponentModel.Composition.AttributedModelServices.GetMetadataView[TMetadataView](IDictionary`2 metadata)
at System.ComponentModel.Composition.ExportServices.CreateStronglyTypedExportOfTM[T,M](Export export)
at System.ComponentModel.Composition.ReflectionModel.ImportType.GetStronglyTypedExport(Export exportToWrap)
at System.ComponentModel.Composition.ReflectionModel.ImportingItem.CastExportsToCollectionImportType(Export[] exports)
at System.ComponentModel.Composition.ReflectionModel.ImportingItem.CastExportsToImportType(Export[] exports)
at System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.SetImport(ImportingItem item, Export[] exports)
at System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.SetImport(ImportDefinition definition, IEnumerable`1 exports)
at System.ComponentModel.Composition.Hosting.ImportEngine.PartManager.TrySetImport(ImportDefinition import, IEnumerable`1 exports)
at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportSubset(PartManager partManager, IEnumerable`1 imports, AtomicComposition atomicComposition)
at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportsStateMachine(PartManager partManager, ComposablePart part)
at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImports(PartManager partManager, ComposablePart part, Boolean shouldTrackImports)
at System.ComponentModel.Composition.Hosting.ImportEngine.SatisfyImports(ComposablePart part)
at System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.<>c__DisplayClass2.<Compose>b__0()
at System.ComponentModel.Composition.Hosting.CompositionServices.TryInvoke(Action action)
at System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.Compose(CompositionBatch batch)
at System.ComponentModel.Composition.Hosting.CompositionContainer.Compose(CompositionBatch batch)
at System.ComponentModel.Composition.AttributedModelServices.ComposeParts(CompositionContainer container, Object[] attributedParts)
at DotNetNuke.ExtensionPoints.ExtensionPointManager.ComposeParts(Object[] attributeParts)
at DotNetNuke.ExtensionPoints.ExtensionPointManager..ctor()
at DotNetNuke.Web.Components.Controllers.ControlBarController..ctor()
--- End of inner exception stack trace ---
Server stack trace:
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
at System.Activator.CreateInstance[T]()
at DotNetNuke.Framework.ServiceLocator`2.InitInstance()
at System.Lazy`1.CreateValue()
Exception rethrown at [0]:
at System.Lazy`1.get_Value()
at DotNetNuke.Framework.ServiceLocator`2.get_Instance()
at DotNetNuke.UI.ControlPanels.ControlBar.LoadCustomMenuItems()
at DotNetNuke.UI.ControlPanels.ControlBar.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.AddedControl(Control control, Int32 index)
at System.Web.UI.ControlCollection.AddAt(Int32 index, Control child)
at DotNetNuke.UI.Skins.Skin.InjectControlPanel()
at DotNetNuke.UI.Skins.Skin.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.AddedControl(Control control, Int32 index)
at System.Web.UI.ControlCollection.Add(Control child)
at DotNetNuke.Framework.DefaultPage.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
--- End of inner exception stack trace ---
I first encountered this exception while running the upgrade directly on the server. I then tried running the upgrade on a local server and pushing the files to the Rackspace server. The upgrade worked fine on the local server but when I tried to login on the Rackspace server it throws the above exception again. Any ideas why it would run locally on a staging machine but not on Rackspace? Any ideas what is causing the exception?
Thanks,
-- Brian