We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

The type initializer for "Syncfusion.ExcelRW.ExcelUtils" threw an exception

Hello together, i have the following problem. I developed an application on our development-server using Syncfusion.ExcelRW.ExcelUtils for reading cell-names from an excel-file. everything works fine. But, when i run the application on another server it produces the following exception: System.TypeInitializationException: The type initializer for "Syncfusion.ExcelRW.ExcelUtils" threw an exception. ---> System.ComponentModel.LicenseException: A valid license cannot be granted for the type Syncfusion.ExcelRW.ExcelRWConfig. Contact the manufacturer of the component for more information. at System.ComponentModel.LicenseManager.Validate(Type type) at Syncfusion.ExcelRW.ExcelEngine..ctor() at Syncfusion.ExcelRW.ExcelUtils..cctor() --- End of inner exception stack trace --- at Syncfusion.ExcelRW.ExcelUtils.Open(Stream stream) at Wächter.ErfassungSE.createErfassung() at Wächter.Controller.button_ErhebungsdatenBearbeiten_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.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) Does someone know how i can fix that problem? thank you in advance :-)

5 Replies

AD Administrator Syncfusion Team April 19, 2005 06:31 PM UTC

Hi Howy, 1) You can just include this license file License or you can include this line in the licenses.licx file of your application Syncfusion.ExcelRW.ExcelRWConfig, Syncfusion.ExcelRW.Base This would embed the syncfusion license. Recompile and deploy the application. 2) You would need to deploy the following dll''s Syncfusion.ExcelRW.Base.dll Syncfusion.Core.dll Syncfusion.Compression.Base.dll Best regards, Stephen. >Hello together, > >i have the following problem. > >I developed an application on our development-server using Syncfusion.ExcelRW.ExcelUtils for reading cell-names from an excel-file. everything works fine. But, when i run the application on another server it produces the following exception: > >System.TypeInitializationException: The type initializer for "Syncfusion.ExcelRW.ExcelUtils" threw an exception. ---> System.ComponentModel.LicenseException: A valid license cannot be granted for the type Syncfusion.ExcelRW.ExcelRWConfig. Contact the manufacturer of the component for more information. > at System.ComponentModel.LicenseManager.Validate(Type type) > at Syncfusion.ExcelRW.ExcelEngine..ctor() > at Syncfusion.ExcelRW.ExcelUtils..cctor() > --- End of inner exception stack trace --- > at Syncfusion.ExcelRW.ExcelUtils.Open(Stream stream) > at Wächter.ErfassungSE.createErfassung() > at Wächter.Controller.button_ErhebungsdatenBearbeiten_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.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) > > >Does someone know how i can fix that problem? > >thank you in advance :-)


HC Hrvoje Canzek April 20, 2005 10:19 AM UTC

thank you very much Stephen for your help. But i fixed that problem. The reason was, that i copied the "debug" version of my application on the other server, where no syncfusion is installed! But now another error occured: The Type initializer for "Syncfusion.ExcelRW.ExcelUtils" threw an exception. at Syncfusion.ExcelRW.ExcelUtils.Open(String fileLocation) Here is the code i am using: IWorkbook myWorkbook = ExcelUtils.Open("example.xls"); IWorksheet sheet = myWorkbook.Worksheets[0]; IWorksheet sheet1 = myWorkbook.Worksheets[1]; IWorksheet sheet2 = myWorkbook.Worksheets[2]; ExcelUtils.ThrowNotSavedOnDestroy = false; IEnumerator ienum = sheet.Names.GetEnumerator(); IEnumerator ienum1 = sheet1.Names.GetEnumerator(); IEnumerator ienum2 = sheet2.Names.GetEnumerator(); What is the problem? Is something wrong with my code or my excel file? or do syncfusion have a bug? I thank you in advance for your help!!! Best regards Howy >Hi Howy, > >1) You can just include this license file > >License > > >or you can include this line in the licenses.licx file of your application > >Syncfusion.ExcelRW.ExcelRWConfig, Syncfusion.ExcelRW.Base > >This would embed the syncfusion license. Recompile and deploy the application. > >2) You would need to deploy the following dll''s > >Syncfusion.ExcelRW.Base.dll >Syncfusion.Core.dll >Syncfusion.Compression.Base.dll > >Best regards, > >Stephen. >


HC Hrvoje Canzek April 20, 2005 10:29 AM UTC

Detailed Information!!!!! i read the following threat http://www.syncfusion.com/Support/forums/message.aspx?MessageID=27870 My Excel sheets are also password protected. My ExcelRW.Base.dll is also version 3.0.1.0 I can use this sheet without errors on my "development server". but if i try to run it on another server this error occured!!!


HC Hrvoje Canzek April 20, 2005 11:43 AM UTC

here is the project. i would be pleased if you would check this out on an server wich have no syncfusion installed!!!! thank you! WindowsApplication1_6147.zip


HC Hrvoje Canzek April 20, 2005 02:14 PM UTC

I got it!!!!! thank you!!! :-)

Loader.
Live Chat Icon For mobile
Up arrow icon