I'm trying to implement simple context menus, but any right click causes the following error:
System.InvalidOperationException
HResult=0x80131509
Message=The service 'Microsoft.DotNet.DesignTools.Client.Designers.IEventHandlerService' must be installed for this feature to work. Ensure that this service is available.
Source=Microsoft.WinForms.Utilities.Shared
StackTrace:
at System.ServiceExtensions.GetRequiredService[TService,TInterface](IServiceProvider provider)
at System.ServiceExtensions.GetCachedService[T](IServiceProvider serviceProvider, T& location)
at Microsoft.DotNet.DesignTools.Client.Designers.InputShield.OnContextMenu(Point screenLocation)
at Microsoft.DotNet.DesignTools.Client.Designers.InputShield.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(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 Microsoft.DotNet.DesignTools.Client.Designers.InputShield.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
IEventHandlerService is internal, so I'm not sure how to "install" it.
Please assist in how to resolve this error and open a simple context menu when right clicking on designer surface
Hi @KlausLoeffelmann
I'm trying to implement simple context menus, but any right click causes the following error:
System.InvalidOperationException HResult=0x80131509 Message=The service 'Microsoft.DotNet.DesignTools.Client.Designers.IEventHandlerService' must be installed for this feature to work. Ensure that this service is available. Source=Microsoft.WinForms.Utilities.Shared StackTrace: at System.ServiceExtensions.GetRequiredService[TService,TInterface](IServiceProvider provider) at System.ServiceExtensions.GetCachedService[T](IServiceProvider serviceProvider, T& location) at Microsoft.DotNet.DesignTools.Client.Designers.InputShield.OnContextMenu(Point screenLocation) at Microsoft.DotNet.DesignTools.Client.Designers.InputShield.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(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 Microsoft.DotNet.DesignTools.Client.Designers.InputShield.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
IEventHandlerService is internal, so I'm not sure how to "install" it.
Please assist in how to resolve this error and open a simple context menu when right clicking on designer surface
Regards Tim
cc @merriemcgaw