Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Upgrading DNN P...Upgrading DNN P...Exception after upgrading to 7.3.3 - Exception has been thrown by the target of an invocation.Exception after upgrading to 7.3.3 - Exception has been thrown by the target of an invocation.
Previous
 
Next
New Post
10/24/2014 6:22 PM
 

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

 
New Post
10/26/2014 4:01 AM
 
At the head of the trace is

System.Security.SecurityException: Request failed.

I guess that something related to Code Access Security is tighter on the Rackapace box than on your local machine.

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
10/26/2014 5:33 PM
 
we use MEF nowadays for injection of some functions - MEF previously required full trust if you used it in .net 2.0/3.5, but in .net 4.0 it no longer requires that - I would check that you are definitely using .net 4.0 as your application pool .net version (if so they rackspace have likely a trust file which locks down MEF as Richard suggests)

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
10/27/2014 8:58 AM
 

Thanks for the suggestions.  I will definitely check with Rackspace again about the app pool and if they are locking down MEF in any way.

 
New Post
3/1/2015 8:46 AM
 
The answer to this issue is to also update the technology to .NET 4.5.
At rackspace, this upgrade is a bit of a pain.
DNN 6.x only works w/.NET 4.0
DNN 7.x only works w/.NET 4.5

7.x w/.NET 4.0 will come up and non-administrative users can login. The admin users cannot (due to the excpetion above).
It's the administrative bar thats being injected into the page that seems to be the issue. If you use a different bar, you can at least login.
However, those older bars barely work any more :-(

Once you've upgraded to 7.x, then go to your rackspace panel and change the technology to .NET 4.5
The change isn't instant, so things get funky for a bit while your site is migrated to a new cluster.
You will also get a new IP address. So patience is required at this point.
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Upgrading DNN P...Upgrading DNN P...Exception after upgrading to 7.3.3 - Exception has been thrown by the target of an invocation.Exception after upgrading to 7.3.3 - Exception has been thrown by the target of an invocation.


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out