Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Class not registered error in vb .net 2003

Status
Not open for further replies.

rohit48

Programmer
Feb 22, 2008
6
US
I am trying to run a exe file in vb .net 2003 environ.I am getting the following error.I am a novice at .net and have no idea what the problem is?


System.Runtime.InteropServices.COMException (0x80040154): Class not registered
at System.Windows.Forms.AxHost.CreateInstance()
at System.Windows.Forms.AxHost.GetOcxCreate()
at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
at System.Windows.Forms.AxHost.CreateHandle()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2407
CodeBase: file:///c:/winxp/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
sbacf
Assembly Version: 1.0.2973.27804
Win32 Version: 1.0.2973.27804
CodeBase: file:///C:/SBACFUpdated/bin/Release/sbacf.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/winxp/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2407
CodeBase: file:///c:/winxp/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 7.0.5000.0
Win32 Version: 7.10.6001.4
CodeBase: file:///c:/winxp/assembly/gac/microsoft.visualbasic/7.0.5000.0__b03f5f7f11d50a3a/microsoft.visualbasic.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/winxp/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
Microsoft.VisualBasic.Compatibility
Assembly Version: 7.0.5000.0
Win32 Version: 7.10.3077
CodeBase: file:///c:/winxp/assembly/gac/microsoft.visualbasic.compatibility/7.0.5000.0__b03f5f7f11d50a3a/microsoft.visualbasic.compatibility.dll
----------------------------------------
AxInterop.ComctlLib
Assembly Version: 1.3.0.0
Win32 Version: 1.3.0.0
CodeBase: file:///C:/SBACFUpdated/bin/Release/AxInterop.ComctlLib.DLL
----------------------------------------
Interop.ComctlLib
Assembly Version: 1.3.0.0
Win32 Version: 1.3.0.0
CodeBase: file:///C:/SBACFUpdated/bin/Release/Interop.ComctlLib.DLL
----------------------------------------
Microsoft.VisualBasic.Compatibility.Data
Assembly Version: 7.0.5000.0
Win32 Version: 7.10.3077
CodeBase: file:///c:/winxp/assembly/gac/microsoft.visualbasic.compatibility.data/7.0.5000.0__b03f5f7f11d50a3a/microsoft.visualbasic.compatibility.data.dll
----------------------------------------
MSDATASRC
Assembly Version: 7.0.3300.0
Win32 Version: 7.00.9466
CodeBase: file:///c:/winxp/assembly/gac/msdatasrc/7.0.3300.0__b03f5f7f11d50a3a/msdatasrc.dll
----------------------------------------
ADODB
Assembly Version: 7.0.3300.0
Win32 Version: 7.10.3077
CodeBase: file:///c:/winxp/assembly/gac/adodb/7.0.3300.0__b03f5f7f11d50a3a/adodb.dll
----------------------------------------
Accessibility
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/winxp/assembly/gac/accessibility/1.0.5000.0__b03f5f7f11d50a3a/accessibility.dll
----------------------------------------
AxInterop.MSDataGridLib
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/SBACFUpdated/bin/Release/AxInterop.MSDataGridLib.DLL
----------------------------------------
Interop.MSDataGridLib
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/SBACFUpdated/bin/Release/Interop.MSDataGridLib.DLL
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.


 
It looks like you have a control that isn't registered. First thing you need to do is figure out which dll is being called that's not registered...then register it using regsvr32.exe

Let's say the dll is named "unreg.dll" and it's in c:\test. Open a cmd prompt and go to c:\test. They type in "regsvr32.exe unreg.dll" and press enter. You should then get a box saying that it was successfully registered (or an error message).
 
macleod1021
How will i know which dll is not registered.Should i repeat the regsvr32.exe for each dll in the solution explorer and see which one causes an error and then add it?
 
macleaod1021,
I am getting an error message when i try to register the dll .Any idea what i should do now?
 
What error are you getting? And what dll?

If it's a 3rd party control, you may need to get an updated version from them. There's other ways to get around it, like creating an interop file for the dll. If it's a Microsoft dll, then just find the updated one and use it instead of the old one.
 
Actually the exe file was working fine.But while was removing dlls and adding them back using solution explorer seems like i have missed something.The error has started ever since.Can you please tell me which dll is missing or needs to be registered or how what exactly i need to do?Kindly help.Again the error is

System.Runtime.InteropServices.COMException (0x80040154): Class not registered
 

Look at the references for your project in solution explorer. If you see an exclamation point or red circle around one, that's what's missing. My guess is that it's one of the libraries in the C:/SBACFUpdated/bin/Release folder.

Does this error occur when you build the project, when try to run it, or after it starts running?

 
pmegan
You are right.I do see exclamation point around some dlls.I removed them and added back.But the error persists.I am able to build the project.Once i build it a exe gets created.When i run the exe the error comes up while the exe is running.To your point i am able to build and start the run.Any idea what i need to do?
 

Put an error trap around your code. This is always a good idea as it lets you control the error messages instead of the letting the end users get ugly errors like the one above.

You should be able to get a general idea of what procedure is executing at the time of the error by watching the program run and finding out when the error occurs.

Go into the code for the suspect procedure and put the code into a try block. Put the following into the catch:

Console.Writeline(ex.StackTrace)
MessageBox.Show(ex.message)

Dig through the stack trace written to the console window and you'll find the line that threw the error. The messagebox is the to let you know the error happened.


 
pmegan
Is there a way to resolve this without touching the code.Just to refresh,the exe was functioning fine till i removed some dlls and added back.Is there a way to find out and add back the missing ones.I have no clue about .net and also did not touch the code.Hence wanted to know if it can be resolved without altering the code.
 
But you did touch the code. You said you were removing references. There's no simple way to do this, you just have to go through the code and figure out what's wrong.

Something that might be of help to you (and I ALWAYS tell new developers to get a copy of this) is Process Monitor. Go to Microsoft Site and do a search. Once you have it downloaded, run the .exe file and it will list everything that happens. You may want to play with the filter to find exactly what you're looking for. Once you kick off your code, it'll show you the dll that it's referencing (and more importantly) WHERE it expects it to be. If I had to guess, I'd say that you don't have the dll in the right directory for it to run.

If you want us to tell you EXACTLY what to do to fix it, then you're going to have to provide us with a LOT more information...and possibly a paycheck :).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top