Failed to load VB.Net form: "Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)) "

1

I'm trying to upgrade an old VB.NET application (which currently runs on Windows XP), to Windows 10. I did an auto update from a VS2010 to a VS2017 project, but when I try to open one of the forms, I get an error in the designer:

Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)) Instances of this error (8)

at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid,Object punkOuter, Int32 context, Guid& iid) at System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid) 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.PerformAdd(IComponent component,String name) at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType, String name) at System.ComponentModel.Design.Serialization.DesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer) at System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.CreateInstanc>e(Type type, ICollection arguments, String name, Boolean addToContainer) at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeInstance(IDesignerSerializationManager manager, Type type, Object[] parameters, String name, Boolean addToContainer) at System.ComponentModel.Design.Serialization.ComponentCodeDomSerializer.DeserializeInstance(IDesignerSerializationManager manager, Type type, Object[] parameters, String name, Boolean addToContainer) at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression) at System.ComponentModel.Design.Serialization.CodeDomSerializer.DeserializeStatementToInstance(IDesignerSerializationManager manager, CodeStatement statement) at System.ComponentModel.Design.Serialization.CodeDomSerializer.Deserialize(IDesignerSerializationManager manager, Object codeObject) at System.Windows.Forms.Design.ControlCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, Object codeObject) at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.DeserializeName(IDesignerSerializationManager manager, String name, CodeStatementCollection statements)

I found a couple of related issues (e.g. here and here), all saying I need to register some COM/ActiveX component.

My question is how do I find the offending component? The exception info does not specify its GUID.

So far I've tried:

  • set target to x86
  • regsvr32
vb.net
com
windows-10
interop
asked on Stack Overflow Jan 6, 2019 by bavaza

1 Answer

0

First off, that doesn’t look like you have built it with a pdb, that should be your first step, see if it doesn’t give you a line number. If that doesn’t work, then you’ll have to open up the *.design.vb file manually delete things until you don’t get that error.

Basically it’s a bit tedious, but not difficult if you understand how things happen in the designer — basically it’s just another class and everything it does you can do manually.

answered on Stack Overflow Jan 6, 2019 by jmoreno

User contributions licensed under CC BY-SA 3.0