Windows Develop Bookmark and Share   
 index > Windows Forms General > Error occured during creating a form
 

Error occured during creating a form

Hi,

I've used mschart control in my application. I'm using clickonce deployment for the deployment of application.

All modules of application 're working fine, except the chart part.

When i install application on my machine (a development machine it'll definitely work), it works fine. but it throws error on user's machine.

When i click on the button, opening the form containing chart control, throws error, which is as follows.

So pls can anyone help me to solve this problem.

Error Details

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.InvalidOperationException: An error occurred creating the form. See Exception.InnerException for details. The error is: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)) ---> System.Runtime.InteropServices.COMException (0x80040154): Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid)
at System.Windows.Forms.AxHost.CreateWithoutLicense(Guid clsid)
at System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid clsid)
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.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.AxHost.EndInit()
at CouponNote.frmStats.InitializeComponent()
at CouponNote.frmStats..ctor()
--- End of inner exception stack trace ---
at CouponNote.My.MyProject.MyForms.Create__Instance__[T](T Instance)
at CouponNote.My.MyProject.MyForms.get_frmStats()
at CouponNote.frmCoupoNoteMain.cmdSTATS_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
CouponNote
Assembly Version: 1.0.3218.28730
Win32 Version: 1.0.3218.28730
CodeBase: file:///C:/Documents%20and%20Settings/SchneiderR/Local%20Settings/Apps/2.0/Y91OWB32.R5E/ANL0XOJX.B4M/coup..tion_8a4740427b54e48f_0001.0000_3401f4a6f837c36e/CouponNote.exe
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Data
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Transactions
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------
AxInterop.MSChart20Lib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.0.0
CodeBase: file:///C:/Documents%20and%20Settings/SchneiderR/Local%20Settings/Apps/2.0/Y91OWB32.R5E/ANL0XOJX.B4M/coup..tion_8a4740427b54e48f_0001.0000_3401f4a6f837c36e/AxInterop.MSChart20Lib.DLL
----------------------------------------
MSDATASRC
Assembly Version: 7.0.3300.0
Win32 Version: 7.00.9466
CodeBase: file:///C:/WINDOWS/assembly/GAC/MSDATASRC/7.0.3300.0__b03f5f7f11d50a3a/MSDATASRC.dll
----------------------------------------
Interop.MSChart20Lib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.0.0
CodeBase: file:///C:/Documents%20and%20Settings/SchneiderR/Local%20Settings/Apps/2.0/Y91OWB32.R5E/ANL0XOJX.B4M/coup..tion_8a4740427b54e48f_0001.0000_3401f4a6f837c36e/Interop.MSChart20Lib.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (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 computer
rather than be handled by this dialog box.


------------------------------------------

Thanks in advance

Sachin

modak.sachin  Wednesday, November 05, 2008 8:28 AM

maybe someClass not registered in the chart control.check the reference in the solution explorer.

find it and register it.

vevi  Wednesday, November 05, 2008 8:59 AM

Hi modak.sachin,

You can try to use Free Registration COM technique.

Instead of registering the Com component in the customer’s machine, Free Registration COM activates the component by reading information from the XML manifest.

To use Free Registration Com technique in your application, please try the following steps:

· Under the reference node of Solution Explorer, please choose MSChartLib.

· Press F4 to show the property grid, set Isolated property to True.

· Under the reference node of Solution Explorer, please choose MSDATASRC

· Press F4 to show the property grid, set Isolated property to True.

Note that there are some registrations of Free Registration COM, however, when I tested with mschart.ocx, it has no problem.

To know more details about Free Registration COM, please refer to this article.

Best Regards,

Bruce Zhou

Bruce.Zhou  Monday, November 10, 2008 8:14 AM

maybe someClass not registered in the chart control.check the reference in the solution explorer.

find it and register it.

vevi  Wednesday, November 05, 2008 8:59 AM

Hi ,

Thanks for your reply.

Well I've developed an application in VS 2005. I'm using mschart control for chart part in my application.

I've registered mschart.ocx on my machine, it's working fine on my machine.

I've used ClickOnce deployment for deploying my application on target machines.

on target (user's)machine , my application is installing properly, but when i click on button, which is opening a form containing chart throws error.

But how would i register mschart.ocx with ClickOnce deployment?

As ClickOnce doesnot write anything in registry.

modak.sachin  Wednesday, November 05, 2008 9:58 AM

Hi modak.sachin,

You can try to use Free Registration COM technique.

Instead of registering the Com component in the customer’s machine, Free Registration COM activates the component by reading information from the XML manifest.

To use Free Registration Com technique in your application, please try the following steps:

· Under the reference node of Solution Explorer, please choose MSChartLib.

· Press F4 to show the property grid, set Isolated property to True.

· Under the reference node of Solution Explorer, please choose MSDATASRC

· Press F4 to show the property grid, set Isolated property to True.

Note that there are some registrations of Free Registration COM, however, when I tested with mschart.ocx, it has no problem.

To know more details about Free Registration COM, please refer to this article.

Best Regards,

Bruce Zhou

Bruce.Zhou  Monday, November 10, 2008 8:14 AM

You can use google to search for other answers

Custom Search

More Threads

• Copy & Paste into Rich Text Box that is in Tab Page
• use of column filtering in the employee table
• keydown event @
• Passing data between two combo boxes
• DataGridView shows wrong tooltip information.
• populate DropDownItems and assign one Click function to all
• scrollbars and the AutoScroll property
• Bound Combo Box Problem
• app.manifest - No longer seems to have an effect
• requested operation cant be performed on file with user-mapped section open