"System.Runtime.InteropServices.COMException (0x80040154)" error message when you add a FormControl control to a Windows Forms project in Visual Studio together with the 64-bit version of InfoPath 2010

Applies to: InfoPath 2010


Consider the following scenario:
  • You install the 64-bit version of Microsoft InfoPath 2010.
  • You create a Windows Forms project in Microsoft Visual Studio.
  • You add an InfoPath FormControl control to the toolbox.
  • You insert the FormControl control on the Windows form.
In this scenario, you receive the following error message:
Failed to create component 'FormControl'. The error message follows:
'System.Runtime.InteropServices.COMException (0x80040154): Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))

at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance (Guid&dsid, Object punkOuter, Int32 context, Guid&iid)

at System.Windows.Forms.AxHost.CreateWithoutLicense(Guid dsid)

at System.Windows.Forms.AxHost.CreateInstance()

at System.Windows.Forms.AxHost.GetOcxCreate()

at System.Windows.Forms.AxHost.set_Site(ISite value)

at System.ComponentModel.Container.Add(IComponent component, String name)

at System.ComponentModel.Design.DesignerHost.Add(IComponent component, String name)

at System.ComponentModel.Design.DesignHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type compontentType, String name)

at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType)
at System.Drawing.Design.Tool...'


There is no workaround for this issue when you use the 64-bit version of InfoPath 2010. To use the InfoPath FormControl control, install the 32-bit version of InfoPath 2010.