{"action":"created","issue":{"url":"https://api.github.com/repos/Epix37/Hearthstone-Deck-Tracker/issues/925","labels_url":"https://api.github.com/repos/Epix37/Hearthstone-Deck-Tracker/issues/925/labels{/name}","comments_url":"https://api.github.com/repos/Epix37/Hearthstone-Deck-Tracker/issues/925/comments","events_url":"https://api.github.com/repos/Epix37/Hearthstone-Deck-Tracker/issues/925/events","html_url":"https://github.com/Epix37/Hearthstone-Deck-Tracker/issues/925","id":72584793,"number":925,"title":"Issue with adding custom plug-in","user":{"login":"ko-vasilev","id":5964618,"avatar_url":"https://avatars.githubusercontent.com/u/5964618?v=3","gravatar_id":"","url":"https://api.github.com/users/ko-vasilev","html_url":"https://github.com/ko-vasilev","followers_url":"https://api.github.com/users/ko-vasilev/followers","following_url":"https://api.github.com/users/ko-vasilev/following{/other_user}","gists_url":"https://api.github.com/users/ko-vasilev/gists{/gist_id}","starred_url":"https://api.github.com/users/ko-vasilev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ko-vasilev/subscriptions","organizations_url":"https://api.github.com/users/ko-vasilev/orgs","repos_url":"https://api.github.com/users/ko-vasilev/repos","events_url":"https://api.github.com/users/ko-vasilev/events{/privacy}","received_events_url":"https://api.github.com/users/ko-vasilev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-05-02T04:42:01Z","updated_at":"2015-05-02T11:33:58Z","closed_at":null,"body":"So I decided to try new plugin support feature, I created a basic project with single class implementing IPlugin and made it to compile to Hearthstone Deck Tracker\\bin\\Debug\\Plugins\r\nIt loads okay, I'm handling OnLoad and one OnUpdate event and then the program crashes with the following error:\r\nSystem.Windows.Markup.XamlParseException was unhandled\r\n  HResult=-2146233087\r\n  Message=Add value to collection of type 'System.Windows.Interactivity.TriggerActionCollection' threw an exception.\r\n  Source=PresentationFramework\r\n  LineNumber=0\r\n  LinePosition=0\r\n  StackTrace:\r\n       at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlReader templateReader, XamlObjectWriter currentWriter)\r\n       at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlObjectWriter objectWriter)\r\n       at System.Windows.FrameworkTemplate.LoadOptimizedTemplateContent(DependencyObject container, IComponentConnector componentConnector, IStyleConnector styleConnector, List`1 affectedChildren, UncommonField`1 templatedNonFeChildrenField)\r\n       at System.Windows.FrameworkTemplate.LoadContent(DependencyObject container, List`1 affectedChildren)\r\n       at System.Windows.StyleHelper.ApplyTemplateContent(UncommonField`1 dataField, DependencyObject container, FrameworkElementFactory templateRoot, Int32 lastChildIndex, HybridDictionary childIndexFromChildID, FrameworkTemplate frameworkTemplate)\r\n       at System.Windows.FrameworkTemplate.ApplyTemplateContent(UncommonField`1 templateDataField, FrameworkElement container)\r\n       at System.Windows.FrameworkElement.ApplyTemplate()\r\n       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n       at System.Windows.UIElement.Measure(Size availableSize)\r\n       at System.Windows.Controls.DockPanel.MeasureOverride(Size constraint)\r\n       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n       at System.Windows.UIElement.Measure(Size availableSize)\r\n       at System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)\r\n       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n       at System.Windows.UIElement.Measure(Size availableSize)\r\n       at System.Windows.Controls.Grid.MeasureOverride(Size constraint)\r\n       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n       at System.Windows.UIElement.Measure(Size availableSize)\r\n       at System.Windows.Controls.Control.MeasureOverride(Size constraint)\r\n       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n       at System.Windows.UIElement.Measure(Size availableSize)\r\n       at System.Windows.Controls.Grid.MeasureOverride(Size constraint)\r\n       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n       at System.Windows.UIElement.Measure(Size availableSize)\r\n       at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)\r\n       at System.Windows.Controls.ItemsPresenter.MeasureOverride(Size constraint)\r\n       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n       at System.Windows.UIElement.Measure(Size availableSize)\r\n       at System.Windows.Controls.Control.MeasureOverride(Size constraint)\r\n       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n       at System.Windows.UIElement.Measure(Size availableSize)\r\n       at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)\r\n       at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)\r\n       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n       at System.Windows.UIElement.Measure(Size availableSize)\r\n       at System.Windows.Controls.Control.MeasureOverride(Size constraint)\r\n       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n       at System.Windows.UIElement.Measure(Size availableSize)\r\n       at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)\r\n       at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)\r\n       at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)\r\n       at System.Windows.Controls.Grid.MeasureOverride(Size constraint)\r\n       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n       at System.Windows.UIElement.Measure(Size availableSize)\r\n       at System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)\r\n       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n       at System.Windows.UIElement.Measure(Size availableSize)\r\n       at System.Windows.Controls.Grid.MeasureOverride(Size constraint)\r\n       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n       at System.Windows.UIElement.Measure(Size availableSize)\r\n       at System.Windows.Window.MeasureOverrideHelper(Size constraint)\r\n       at System.Windows.Window.MeasureOverride(Size availableSize)\r\n       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n       at System.Windows.UIElement.Measure(Size availableSize)\r\n       at System.Windows.Interop.HwndSource.SetLayoutSize()\r\n       at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)\r\n       at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)\r\n       at System.Windows.Window.SetRootVisual()\r\n       at System.Windows.Window.SetRootVisualAndUpdateSTC()\r\n       at System.Windows.Window.SetupInitialState(Double requestedTop, Double requestedLeft, Double requestedWidth, Double requestedHeight)\r\n       at System.Windows.Window.CreateSourceWindow(Boolean duringShow)\r\n       at System.Windows.Window.CreateSourceWindowDuringShow()\r\n       at System.Windows.Window.SafeCreateWindowDuringShow()\r\n       at System.Windows.Window.ShowHelper(Object booleanBox)\r\n       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)\r\n       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)\r\n       at System.Windows.Threading.DispatcherOperation.InvokeImpl()\r\n       at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)\r\n       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)\r\n       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)\r\n       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n       at System.Windows.Threading.DispatcherOperation.Invoke()\r\n       at System.Windows.Threading.Dispatcher.ProcessQueue()\r\n       at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)\r\n       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)\r\n       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)\r\n       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)\r\n       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)\r\n       at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)\r\n       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)\r\n       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)\r\n       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)\r\n       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)\r\n       at System.Windows.Threading.Dispatcher.Run()\r\n       at System.Windows.Application.RunDispatcher(Object ignore)\r\n       at System.Windows.Application.RunInternal(Window window)\r\n       at System.Windows.Application.Run(Window window)\r\n       at System.Windows.Application.Run()\r\n       at Hearthstone_Deck_Tracker.App.Main() in e:\\Projects\\HearthstoneDeckTracker\\Hearthstone Deck Tracker\\obj\\Debug\\App.g.cs:line 0\r\n       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)\r\n       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)\r\n       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)\r\n       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)\r\n       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n       at System.Threading.ThreadHelper.ThreadStart()\r\n  InnerException: System.ArgumentException\r\n       HResult=-2147024809\r\n       Message=Cannot add instance of type 'SetFlyoutOpenAction' to a collection of type 'TriggerActionCollection'. Only items of type 'T' are allowed.\r\n       Source=PresentationCore\r\n       StackTrace:\r\n            at System.Windows.FreezableCollection`1.Cast(Object value)\r\n            at System.Windows.FreezableCollection`1.System.Collections.IList.Add(Object value)\r\n            at System.Xaml.Schema.XamlTypeInvoker.AddToCollection(Object instance, Object item)\r\n            at MS.Internal.Xaml.Runtime.ClrObjectRuntime.Add(Object collection, XamlType collectionType, Object value, XamlType valueXamlType)\r\n       InnerException: \r\n\r\n\r\n**(note: I'm returning null from MenuItem)**\r\nFeel free to ask any questions, I would glad to help! Or maybe I'm doing something wrong?"},"comment":{"url":"https://api.github.com/repos/Epix37/Hearthstone-Deck-Tracker/issues/comments/98349711","html_url":"https://github.com/Epix37/Hearthstone-Deck-Tracker/issues/925#issuecomment-98349711","issue_url":"https://api.github.com/repos/Epix37/Hearthstone-Deck-Tracker/issues/925","id":98349711,"user":{"login":"Epix37","id":7737910,"avatar_url":"https://avatars.githubusercontent.com/u/7737910?v=3","gravatar_id":"","url":"https://api.github.com/users/Epix37","html_url":"https://github.com/Epix37","followers_url":"https://api.github.com/users/Epix37/followers","following_url":"https://api.github.com/users/Epix37/following{/other_user}","gists_url":"https://api.github.com/users/Epix37/gists{/gist_id}","starred_url":"https://api.github.com/users/Epix37/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Epix37/subscriptions","organizations_url":"https://api.github.com/users/Epix37/orgs","repos_url":"https://api.github.com/users/Epix37/repos","events_url":"https://api.github.com/users/Epix37/events{/privacy}","received_events_url":"https://api.github.com/users/Epix37/received_events","type":"User","site_admin":false},"created_at":"2015-05-02T11:33:58Z","updated_at":"2015-05-02T11:33:58Z","body":"So I tracked down the issue: the crash happens in the [PluginManager update method](https://github.com/Epix37/Hearthstone-Deck-Tracker/blob/master/Hearthstone%20Deck%20Tracker/Plugins/PluginManager.cs#L132), *if and only if* the System.Windows.Interactivity.dll is in the Plugins directory.\r\n\r\nNo idea what to make of that though."}}