Invoked member is not supported in a dynamic assembly


Author
Message
Chris Diesel
Chris Diesel
StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)
Group: StrataFrame Users
Posts: 74, Visits: 300
Trying to move from .Net 3.5 to 4.0 and I'm getting "The invoked member is not supported in a dynamic assembly." on this line:

StrataFrameApplication.RunApplication();

Any ideas???
StrataFrame Team
S
StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Have you recompiled the SF source code in 4.0?
Chris Diesel
Chris Diesel
StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)
Group: StrataFrame Users
Posts: 74, Visits: 300
Yes.
StrataFrame Team
S
StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
What is the call stack of the exception that is thrown?  Does it contain Assembly.GetTypes() or AssemblyBuilder.GetTypes()?  Googling the error it seems as though the  .NET 4.0 runtime has tightened down the ability to use Assembly.Load dynamically to load assemblies that are not explicitly referenced, for instance, plug-ins.  There is an app.config setting that can allow them to run, though:

Chris Diesel
Chris Diesel
StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)
Group: StrataFrame Users
Posts: 74, Visits: 300
Saw that ealier and tried it again but doesn't help.

loadFromRemoteSources enabled="true"

Stack Trace:

   at System.Reflection.Emit.InternalAssemblyBuilder.GetManifestResourceNames()
   at MicroFour.StrataFrame.Application.StrataFrameApplication.LoadLocalizationFromAssembly(Assembly LoadedAssembly)
   at MicroFour.StrataFrame.Application.StrataFrameApplication.RunApplication()
   at IwSystemsCore.clsIwSystemsCore.Main(clsProcessing oStartProc, String fullAssemblyName) in c:\VssProjs\IwSystems\Development\IwApplications\IwSystemsMain\IwSystemsCore\SharedCore\IwSystemsCore.cs:line 188
   at IwSystemsStartup.IwSystemsStartupMain.Main() in c:\VssProjs\IwSystems\Development\IwApplications\IwSystemsMain\IwSystemsStartup\SharedStartup\IwSystemsStartupMain.cs:line 27
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at System.AppDomain.nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
   at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
   at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
   at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
   at System.Activator.CreateInstance(ActivationContext activationContext)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
StrataFrame Team
S
StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Can you build SF in debug mode and break in the StrataFrameApplication.LoadLocalizationFromAssembly() method?  It would help to know what assembly is causing the error.
Chris Diesel
Chris Diesel
StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)
Group: StrataFrame Users
Posts: 74, Visits: 300
In strataframeapplication.vb

erroring on this line...'-- Check the manifests for the xml files and register them if possible

For Each lcFile As String In LoadedAssembly.GetManifestResourceNames()

 

StrataFrame Team
S
StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Yeah, sorry, it's looping through the assemblies, right?  What assembly is it trying to call GetManifestResourceNames on?
Chris Diesel
Chris Diesel
StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)StrataFrame Novice (114 reputation)
Group: StrataFrame Users
Posts: 74, Visits: 300
Not sure if this is right...

LoadedAssembly is showing: {Microsoft.GeneratedCode, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null}
StrataFrame Team
S
StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
That actually makes sense that "GeneratedCode" would be a dynamic assembly.  Looks like there are 2 ways to fix this:

1) If you're not using localization, set StrataFrameApplication.IgnoreLoadLocalization = true; before you call StrataFrameApplication.Run() and the whole process will be skipped.

2) If you need localization, you'll need to change the second If test in the StrataFrameApplication.LoadLocalizationFromAssembly() method to have a second OrElse like this:

If TypeOf LoadedAssembly Is System.Reflection.Emit.AssemblyBuilder OrElse LoadedAssembly.IsDynamic Then

This can only be done if you're building in 4.0 because the Assembly.IsDynamic properti does not exist in 2.0.

One of those should get you fixed.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search