Initialization [Warning] GetExcelAddIns CreateInstance problem for type: SaxoExcelTrader.Application.CTP.ExcelTraderRibbon - exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for '<Module>' threw an exception. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at ()
at .cctor()
--- End of inner exception stack trace ---
at SaxoExcelTrader.Application.DIEngine.Register()
at SaxoExcelTrader.Application.Bootstrap.Init()
--- End of inner exception 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, StackCrawlMark& stackMark)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at ExcelDna.Integration.AssemblyLoader.GetExcelAddIns(ExportedAssembly assembly, Type t, Boolean loadRibbons, List`1 addIns)
Initialization [Error] DnaLibrary AutoOpen Error : TargetInvocationException - Exception has been thrown by the target of an invocation.
Please could you help with the above error.
Thanks,
Saurabh
Hi Saurabh,
This sounds like something specific to your add-in and its dependencies.
You might need to start from a very simple version that works under Excel 2013, and then add back features and dependencies until you track down the source of the problem.
It doesn’t sound like a general Excel-DNA issue.
-Govert
--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
exceldna+u...@googlegroups.com.
To post to this group, send email to exce...@googlegroups.com.
Visit this group at https://groups.google.com/group/exceldna.
For more options, visit https://groups.google.com/d/optout.
It might be better to do that call, and similar initialization, in the IExcelAddIn.AutoOpen().
It’s less predictable where the class gets constructed, and might not be in a context where the C API will work.