Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Exception has been thrown by the target of an invocation. While using DesignerHost
 

Exception has been thrown by the target of an invocation. While using DesignerHost

Hi All

I am getting this error while using Idesigner for custom form Designer. Any ideas..

Any help would be great, Thanks.

System.Reflection.TargetInvocationException was caught
Message="Exception has been thrown by the target of an invocation."
Source="mscorlib"
StackTrace:
at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, SignatureStruct& signature, IntPtr declaringType)
at System.RuntimeMethodHandle.InvokeConstructor(Object[] args, SignatureStruct signature, RuntimeTypeHandle declaringType)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.ConstructorInfo.Invoke(Object[] parameters)
at System.SecurityUtils.SecureConstructorInvoke(Type type, Type[] argTypes, Object[] args, Boolean allowNonPublic, BindingFlags extraFlags)
at System.ComponentModel.ReflectTypeDescriptionProvider.CreateInstance(IServiceProvider provider, Type objectType, Type[] argTypes, Object[] args)
at System.ComponentModel.TypeDescriptor.TypeDescriptionNode.CreateInstance(IServiceProvider provider, Type objectType, Type[] argTypes, Object[] args)
at System.ComponentModel.TypeDescriptor.CreateInstance(IServiceProvider provider, Type objectType, Type[] argTypes, Object[] args)
at System.ComponentModel.Design.DesignSurface.CreateInstance(Type type)
at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType, String name)
at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType)
at System.Drawing.Design.ToolboxItem.CreateComponentsCore(IDesignerHost host)
at System.Drawing.Design.ToolboxItem.CreateComponentsCore(IDesignerHost host, IDictionary defaultValues)
at System.Drawing.Design.ToolboxItem.CreateComponents(IDesignerHost host, IDictionary defaultValues)
at System.Windows.Forms.Design.OleDragDropHandler.CreateTool(ToolboxItem tool, Control parent, Int32 x, Int32 y, Int32 width, Int32 height, Boolean hasLocation, Boolean hasSize, ToolboxSnapDragDropEventArgs e)
at System.Windows.Forms.Design.ParentControlDesigner.CreateToolCore(ToolboxItem tool, Int32 x, Int32 y, Int32 width, Int32 height, Boolean hasLocation, Boolean hasSize)
at System.Windows.Forms.Design.ParentControlDesigner.CreateTool(ToolboxItem tool, Point location)
at System.Windows.Forms.Design.ParentControlDesigner.OnMouseDragEnd(Boolean cancel)

Kish_UNI  Thursday, November 02, 2006 5:46 AM

Check some from this list:

+ Is your custom tool inheriting fom Icomponent?

+ Are you implementig ISerialize or Serializable?. Seems like some member can't be deserialized. Check if all related class can be serialized. If all are fine.... check that cast for the members coincide with the member's type.

Tabas  Thursday, November 02, 2006 2:57 PM

You can use google to search for other answers

Custom Search

More Threads

• Button Text and Image depression
• VB background image properties
• Noob question about Composite Controls
• can i custom the display Name for toolboxitem on toolbox.
• TabControl
• Form lost objects in design window
• sql server name
• How to programmatically create resource (resx) file given control.
• Form class label. Printing to from another class
• Designer Save Bug