这些例外是什么意思?

时间:2009-07-07 19:07:10

标签: wpf

有人可以解释下面的例外情况吗?在我的WPF用户控件构造函数中执行InitializeComponents时会发生这种情况。我正在使用.net4,以防它的版本特定。我真的不知道应该搜索什么。

编辑: 正如您所看到的,当我添加xmlns时,XAML代码不执行任何操作并发生异常:Converters =“clr-namespace:ICSharpCode.ShortcutsManagement.Converters”或我项目中的任何其他命名空间

XAML

<UserControl x:Class="ICSharpCode.ShortcutsManagement.Dialogs.ShortcutsManagementOptionsPanel"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Converters="clr-namespace:ICSharpCode.ShortcutsManagement.Converters"
    x:Name="_this">

    <Grid>
    </Grid>
</UserControl>

背后的代码

namespace ICSharpCode.ShortcutsManagement.Dialogs
{
    public partial class ShortcutsManagementOptionsPanel : UserControl, IOptionPanel
    {
        public ShortcutsManagementOptionsPanel()
        {
            InitializeComponent();
        }

        public void LoadOptions()
        {
        }

        public bool SaveOptions() 
        {
            return true;
        }

        public object Owner {
            get; set;
        }

        public object Control {
            get 
            { 
                return null; 
            }
        }
    }
}

抛出异常:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Windows.Markup.XamlParseException: Cannot assign root instance of type 'ShortcutsManagementOptionsPanel' to type 'ShortcutsManagementOptionsPanel'. ---> System.Xaml.XamlParseException: Cannot assign root instance of type 'ShortcutsManagementOptionsPanel' to type 'ShortcutsManagementOptionsPanel'.
at System.Xaml.XamlObjectWriter.WriteStartObject(XamlType xamlType)
at System.Xaml.XamlWriter.WriteNode(XamlReader reader)
at System.Windows.Markup.XamlReader.WpfXamlLoader.LoadOneNode(XamlReader xamlReader, XamlObjectWriter xamlWriter, Boolean skipJournaledProperties, Boolean shouldPassLineNumberInfo, IXamlLineInfo xamlLineInfo, IXamlLineInfoConsumer xamlLineInfoConsumer, Stack`1 stack, IStyleConnector styleConnector)
at System.Windows.Markup.XamlReader.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings)
--- End of inner exception stack trace ---
at System.Windows.Markup.XamlReader.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings)
at System.Windows.Markup.XamlReader.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
at ICSharpCode.ShortcutsManagement.Dialogs.ShortcutsManagementOptionsPanel.InitializeComponent() in c:\VSC\SharpDevelop40\SharpDevelop\src\AddIns\Misc\ShortcutsManagement\Src\Dialogs\ShortcutsManagementOptionsPanel.xaml:line 1
at ICSharpCode.ShortcutsManagement.Dialogs.ShortcutsManagementOptionsPanel..ctor() in c:\VSC\SharpDevelop40\SharpDevelop\src\AddIns\Misc\ShortcutsManagement\Src\Dialogs\ShortcutsManagementOptionsPanel.xaml.cs:line 30
--- 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 fillCache)
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at ICSharpCode.Core.AddIn.CreateObject(String className) in c:\VSC\SharpDevelop40\SharpDevelop\src\Main\Core\Project\Src\AddInTree\AddIn\AddIn.cs:line 34
at ICSharpCode.SharpDevelop.DefaultOptionPanelDescriptor.get_OptionPanel() in c:\VSC\SharpDevelop40\SharpDevelop\src\Main\Base\Project\Src\Internal\Doozers\DefaultOptionPanelDescriptor.cs:line 42
at ICSharpCode.SharpDevelop.Gui.TreeViewOptionsDialog.OptionPanelNode.get_Content() in c:\VSC\SharpDevelop40\SharpDevelop\src\Main\Base\Project\Src\Gui\Dialogs\TreeViewOptionsDialog.xaml.cs:line 121
at ICSharpCode.SharpDevelop.Gui.TreeViewOptionsDialog.SelectNode(OptionPanelNode node) in c:\VSC\SharpDevelop40\SharpDevelop\src\Main\Base\Project\Src\Gui\Dialogs\TreeViewOptionsDialog.xaml.cs:line 80
at ICSharpCode.SharpDevelop.Gui.TreeViewOptionsDialog.OptionPanelNode.set_IsSelected(Boolean value) in c:\VSC\SharpDevelop40\SharpDevelop\src\Main\Base\Project\Src\Gui\Dialogs\TreeViewOptionsDialog.xaml.cs:line 199

---- Recent log messages:
22:36:19.046 [9] DEBUG - SVN: SingleStatus.callback(C:\VSC\SharpDevelop40\SharpDevelop\src\AddIns\Misc\ShortcutsManagement\Src\Dialogs\ShortcutsTreeView.xaml.cs,Normal)
22:36:19.046 [9] DEBUG - SVN: SingleStatus(C:\VSC\SharpDevelop40\SharpDevelop\src\AddIns\Misc\ShortcutsManagement\Src\Extensions\TextBlockBehavior.cs)
22:36:19.046 [9] DEBUG - SVN: SingleStatus.callback(C:\VSC\SharpDevelop40\SharpDevelop\src\AddIns\Misc\ShortcutsManagement\Src\Extensions\TextBlockBehavior.cs,Normal)
22:36:19.046 [9] DEBUG - SVN: SingleStatus(C:\VSC\SharpDevelop40\SharpDevelop\src\AddIns\Misc\ShortcutsManagement\Src\Extensions\TreeViewExtensions.cs)
22:36:19.046 [9] DEBUG - SVN: SingleStatus.callback(C:\VSC\SharpDevelop40\SharpDevelop\src\AddIns\Misc\ShortcutsManagement\Src\Extensions\TreeViewExtensions.cs,Normal)
22:36:19.046 [9] DEBUG - SVN: SingleStatus(C:\VSC\SharpDevelop40\SharpDevelop\src\Main\Core\Project)
22:36:19.046 [9] DEBUG - SVN: SingleStatus.callback(C:\VSC\SharpDevelop40\SharpDevelop\src\Main\Core\Project,Normal)
22:36:19.046 [9] DEBUG - SVN: SingleStatus(C:\VSC\SharpDevelop40\SharpDevelop\src\Main\ICSharpCode.Core.Presentation)
22:36:19.062 [9] DEBUG - SVN: SingleStatus.callback(C:\VSC\SharpDevelop40\SharpDevelop\src\Main\ICSharpCode.Core.Presentation,Normal)
22:36:19.062 [9] DEBUG - SVN: SingleStatus(C:\VSC\SharpDevelop40\SharpDevelop\src\Main\ICSharpCode.Core.WinForms)
22:36:19.062 [9] DEBUG - SVN: SingleStatus.callback(C:\VSC\SharpDevelop40\SharpDevelop\src\Main\ICSharpCode.Core.WinForms,Normal)
22:36:19.062 [9] DEBUG - SVN: SingleStatus(C:\VSC\SharpDevelop40\SharpDevelop\src\Main\ICSharpCode.SharpDevelop.Dom\Project)
22:36:19.062 [9] DEBUG - SVN: SingleStatus.callback(C:\VSC\SharpDevelop40\SharpDevelop\src\Main\ICSharpCode.SharpDevelop.Dom\Project,Normal)
22:36:19.062 [9] DEBUG - SVN: SingleStatus(C:\VSC\SharpDevelop40\SharpDevelop\src\Main\ICSharpCode.SharpDevelop.Sda)
22:36:19.062 [9] DEBUG - SVN: SingleStatus.callback(C:\VSC\SharpDevelop40\SharpDevelop\src\Main\ICSharpCode.SharpDevelop.Sda,Normal)
22:36:19.062 [9] DEBUG - SVN: SingleStatus(C:\VSC\SharpDevelop40\SharpDevelop\src\Main\Base\Project)
22:36:19.062 [9] DEBUG - SVN: SingleStatus.callback(C:\VSC\SharpDevelop40\SharpDevelop\src\Main\Base\Project,Normal)
22:36:19.062 [9] DEBUG - SVN: SingleStatus(C:\VSC\SharpDevelop40\SharpDevelop\src\Main\ICSharpCode.SharpDevelop.Widgets\Project)
22:36:19.062 [9] DEBUG - SVN: SingleStatus.callback(C:\VSC\SharpDevelop40\SharpDevelop\src\Main\ICSharpCode.SharpDevelop.Widgets\Project,Normal)
22:36:19.062 [9] DEBUG - SVN: SingleStatus(C:\VSC\SharpDevelop40\SharpDevelop\src\Main\StartUp\Project)
22:36:19.062 [9] DEBUG - SVN: SingleStatus.callback(C:\VSC\SharpDevelop40\SharpDevelop\src\Main\StartUp\Project,Normal)
22:36:19.062 [9] DEBUG - SVN: OverlayIconManager Thread finished
22:36:19.171 [1] INFO - Loading addin ICSharpCode.ShortcutsManagement.exe
22:36:19.359 [1] ERROR - 
--> Exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Windows.Markup.XamlParseException: Cannot assign root instance of type 'ShortcutsManagementOptionsPanel' to type 'ShortcutsManagementOptionsPanel'. ---> System.Xaml.XamlParseException: Cannot assign root instance of type 'ShortcutsManagementOptionsPanel' to type 'ShortcutsManagementOptionsPanel'.
at System.Xaml.XamlObjectWriter.WriteStartObject(XamlType xamlType)
at System.Xaml.XamlWriter.WriteNode(XamlReader reader)
at System.Windows.Markup.XamlReader.WpfXamlLoader.LoadOneNode(XamlReader xamlReader, XamlObjectWriter xamlWriter, Boolean skipJournaledProperties, Boolean shouldPassLineNumberInfo, IXamlLineInfo xamlLineInfo, IXamlLineInfoConsumer xamlLineInfoConsumer, Stack`1 stack, IStyleConnector styleConnector)
at System.Windows.Markup.XamlReader.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings)
--- End of inner exception stack trace ---
at System.Windows.Markup.XamlReader.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings)
at System.Windows.Markup.XamlReader.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
at ICSharpCode.ShortcutsManagement.Dialogs.ShortcutsManagementOptionsPanel.InitializeComponent() in c:\VSC\SharpDevelop40\SharpDevelop\src\AddIns\Misc\ShortcutsManagement\Src\Dialogs\ShortcutsManagementOptionsPanel.xaml:line 1
at ICSharpCode.ShortcutsManagement.Dialogs.ShortcutsManagementOptionsPanel..ctor() in c:\VSC\SharpDevelop40\SharpDevelop\src\AddIns\Misc\ShortcutsManagement\Src\Dialogs\ShortcutsManagementOptionsPanel.xaml.cs:line 30
--- 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 fillCache)
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at ICSharpCode.Core.AddIn.CreateObject(String className) in c:\VSC\SharpDevelop40\SharpDevelop\src\Main\Core\Project\Src\AddInTree\AddIn\AddIn.cs:line 34
at ICSharpCode.SharpDevelop.DefaultOptionPanelDescriptor.get_OptionPanel() in c:\VSC\SharpDevelop40\SharpDevelop\src\Main\Base\Project\Src\Internal\Doozers\DefaultOptionPanelDescriptor.cs:line 42
at ICSharpCode.SharpDevelop.Gui.TreeViewOptionsDialog.OptionPanelNode.get_Content() in c:\VSC\SharpDevelop40\SharpDevelop\src\Main\Base\Project\Src\Gui\Dialogs\TreeViewOptionsDialog.xaml.cs:line 121
at ICSharpCode.SharpDevelop.Gui.TreeViewOptionsDialog.SelectNode(OptionPanelNode node) in c:\VSC\SharpDevelop40\SharpDevelop\src\Main\Base\Project\Src\Gui\Dialogs\TreeViewOptionsDialog.xaml.cs:line 80
at ICSharpCode.SharpDevelop.Gui.TreeViewOptionsDialog.OptionPanelNode.set_IsSelected(Boolean value) in c:\VSC\SharpDevelop40\SharpDevelop\src\Main\Base\Project\Src\Gui\Dialogs\TreeViewOptionsDialog.xaml.cs:line 199
22:36:19.562 [1] WARN - Stack trace of last error log:
at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
at System.Environment.get_StackTrace()
at ICSharpCode.Core.MessageService.ShowError(Exception ex, String message) in c:\VSC\SharpDevelop40\SharpDevelop\src\Main\Core\Project\Src\Services\MessageService\MessageService.cs:line 72
at ICSharpCode.Core.MessageService.ShowError(Exception ex) in c:\VSC\SharpDevelop40\SharpDevelop\src\Main\Core\Project\Src\Services\MessageService\MessageService.cs:line 37
at ICSharpCode.SharpDevelop.Gui.TreeViewOptionsDialog.OptionPanelNode.set_IsSelected(Boolean value) in c:\VSC\SharpDevelop40\SharpDevelop\src\Main\Base\Project\Src\Gui\Dialogs\TreeViewOptionsDialog.xaml.cs:line 201
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
at MS.Internal.Data.PropertyPathWorker.SetValue(Object item, Object value)
at MS.Internal.Data.ClrBindingWorker.UpdateValue(Object value)
at System.Windows.Data.BindingExpression.UpdateSource(Object value)
at System.Windows.Data.BindingExpressionBase.UpdateValue()
at System.Windows.Data.BindingExpression.Update(Boolean synchronous)
at System.Windows.Data.BindingExpressionBase.Dirty()
at System.Windows.Data.BindingExpression.SetValue(DependencyObject d, DependencyProperty dp, Object value)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at System.Windows.Controls.TreeView.ChangeSelection(Object data, TreeViewItem container, Boolean selected)
at System.Windows.Controls.TreeViewItem.Select(Boolean selected)
at System.Windows.Controls.TreeViewItem.OnGotFocus(RoutedEventArgs e)
at System.Windows.UIElement.IsFocused_Changed(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyPropertyKey key, Object value)
at System.Windows.Input.FocusManager.OnFocusedElementChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at System.Windows.Input.FocusManager.SetFocusedElement(DependencyObject element, IInputElement value)
at System.Windows.Input.KeyboardNavigation.UpdateFocusedElement(DependencyObject focusTarget)
at System.Windows.FrameworkElement.OnGotKeyboardFocus(Object sender, KeyboardFocusChangedEventArgs e)
at System.Windows.Input.KeyboardFocusChangedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.KeyboardDevice.ChangeFocus(DependencyObject focus, Int32 timestamp)
at System.Windows.Input.KeyboardDevice.TryChangeFocus(DependencyObject newFocus, IKeyboardInputProvider keyboardInputProvider, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
at System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew)
at System.Windows.Input.KeyboardDevice.Focus(IInputElement element)
at System.Windows.UIElement.Focus()
at System.Windows.Controls.TreeViewItem.OnMouseLeftButtonDown(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseLeftButtonDownThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
at System.Windows.Forms.Integration.WindowsFormsHost.ActivateWindowListener.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Window.ShowHelper(Object booleanBox)
at System.Windows.Window.Show()
at System.Windows.Window.ShowDialog()
at ICSharpCode.SharpDevelop.Commands.OptionsCommand.ShowTreeOptions(String dialogTitle, AddInTreeNode node) in c:\VSC\SharpDevelop40\SharpDevelop\src\Main\Base\Project\Src\Commands\ToolsCommands.cs:line 54
at ICSharpCode.SharpDevelop.Commands.OptionsCommand.Run() in c:\VSC\SharpDevelop40\SharpDevelop\src\Main\Base\Project\Src\Commands\ToolsCommands.cs:line 59
at ICSharpCode.Core.Presentation.CommandWrapper.Execute(Object parameter) in c:\VSC\SharpDevelop40\SharpDevelop\src\Main\ICSharpCode.Core.Presentation\Menu\MenuCommand.cs:line 97
at ICSharpCode.Core.Presentation.CommandBindingInfo.GenerateExecutedEventHandler(Object sender, ExecutedRoutedEventArgs e) in c:\VSC\SharpDevelop40\SharpDevelop\src\Main\ICSharpCode.Core.Presentation\CommandsService\CommandBindingInfo.cs:line 364
at System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
at System.Windows.Input.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)
at System.Windows.Input.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
at System.Windows.Input.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
at System.Windows.Input.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
at System.Windows.UIElement.OnExecutedThunk(Object sender, ExecutedRoutedEventArgs e)
at System.Windows.Input.ExecutedRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)
at System.Windows.Input.RoutedCommand.ExecuteCore(Object parameter, IInputElement target, Boolean userInitiated)
at System.Windows.Input.CommandManager.TransferEvent(IInputElement newSource, ExecutedRoutedEventArgs e)
at System.Windows.Input.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
at System.Windows.UIElement.OnExecutedThunk(Object sender, ExecutedRoutedEventArgs e)
at System.Windows.Input.ExecutedRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)
at System.Windows.Input.RoutedCommand.ExecuteCore(Object parameter, IInputElement target, Boolean userInitiated)
at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
at System.Windows.Controls.MenuItem.InvokeClickAfterRender(Object arg)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at ICSharpCode.SharpDevelop.Commands.StartWorkbenchCommand.Run(IList`1 fileList) in c:\VSC\SharpDevelop40\SharpDevelop\src\Main\Base\Project\Src\Commands\AutostartCommands.cs:line 145
at ICSharpCode.SharpDevelop.Sda.CallHelper.RunWorkbenchInternal(Object settings) in c:\VSC\SharpDevelop40\SharpDevelop\src\Main\ICSharpCode.SharpDevelop.Sda\Src\CallHelper.cs:line 136
at ICSharpCode.SharpDevelop.Sda.CallHelper.RunWorkbench(WorkbenchSettings settings) in c:\VSC\SharpDevelop40\SharpDevelop\src\Main\ICSharpCode.SharpDevelop.Sda\Src\CallHelper.cs:line 114
at ICSharpCode.SharpDevelop.Sda.SharpDevelopHost.RunWorkbench(WorkbenchSettings settings) in c:\VSC\SharpDevelop40\SharpDevelop\src\Main\ICSharpCode.SharpDevelop.Sda\Src\SharpDevelopHost.cs:line 117
at ICSharpCode.SharpDevelop.SharpDevelopMain.RunApplication() in c:\VSC\SharpDevelop40\SharpDevelop\src\Main\StartUp\Project\SharpDevelopMain.cs:line 178
at ICSharpCode.SharpDevelop.SharpDevelopMain.Run() in c:\VSC\SharpDevelop40\SharpDevelop\src\Main\StartUp\Project\SharpDevelopMain.cs:line 108
at ICSharpCode.SharpDevelop.SharpDevelopMain.Main(String[] args) in c:\VSC\SharpDevelop40\SharpDevelop\src\Main\StartUp\Project\SharpDevelopMain.cs:line 58

---- Post-error application state information:
Installed 3rd party AddIns: [Workflow Foundation Designer, Enabled=True, Action=Enable], [ShortcutsManagement, Enabled=True, Action=Enable]
Workbench.ActiveContent: ICSharpCode.SharpDevelop.Gui.ErrorListPad
ProjectService.OpenSolution: [Solution: FileName=C:\VSC\SharpDevelop40\SharpDevelop\SharpDevelop.sln, HasProjects=True, ReadOnly=False]
ProjectService.CurrentProject: [CSharpProject: ICSharpCode.Core]

2 个答案:

答案 0 :(得分:1)

没有阅读所有2千行。

当您看到 System.Reflection.TargetInvocationException 时,这意味着从委托调用的函数引发了异常。

看起来您正在为ShortcutsManagementOptionsPanel分配无效的根实例。

无法将类型为“ShortcutsManagementOptionsPanel”的根实例分配为“ShortcutsManagementOptionsPanel”。

答案 1 :(得分:1)

在Visual Studio中,确保设置Debug&gt;例外&gt;打破CLR异常“Thrown”

您可能会以这种方式获得更有意义的例外。

-dk