mercredi 25 février 2015

Application object is being shut down exception

I'm developing an Excel add-in using multiple windows forms and multiple Element host objects to contain WPF controls. I also have a form which calls to a web service. And displays the results back to Excel.


The problem I'm currently facing is the current : After some interaction with the addin ( no specific order has been found ) my addin stops behaving correctly, throwing an invalid operation exception somewhere inside the PresentationFramework.dll . I can't inspect the code that's running in there because it's hidden.


The Exception says the following : "Application object is being shut down".


What could be causing this?


It is thrown at initialization of a control that is used for some custom drawings



InitializeComponent();


The stack trace looks like this :


" at System.Windows.Application.GetResourcePackage(Uri packageUri)\r\n at System.Windows.Application.GetResourceOrContentPart(Uri uri)\r\n at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)\r\n at Drawing.MoleculeView.InitializeComponent() in d:\Projects\Common\Depict\Drawing\MoleculeView.xaml:line 1\r\n at Drawing.MoleculeView..ctor() in d:\Projects\Common\Depict\Drawing\MoleculeView.xaml.cs:line 192\r\n at DrawingControlWrapper.MultipleDrawingControl.LoadMolecule(Molecule molecules, Point[] bounds) in c:\Users\Nikolay\Desktop\Addin\DrawingControlWrapper\MultipleDrawingControl.xaml.cs:line 32\r\n at CallSite.Target(Closure , CallSite , MultipleDrawingControl , Object , Point[] )\r\n at LMCExcelFunctions.ThisAddIn.QueueMolecule(Object mol) in c:\Users\Nikolay\Desktop\Addin\LMCExcelFunctions\ThisAddIn.cs:line 182\r\n at CallSite.Target(Closure , CallSite , Type , Object )\r\n at LMCExcelFunctions.ThisAddIn.addin_SheetSelectionChange(Object sh, Range target) in c:\Users\Nikolay\Desktop\Addin\LMCExcelFunctions\ThisAddIn.cs:line 93"


Aucun commentaire:

Enregistrer un commentaire