I have recently wrote a program in C#, and utilizing Aspose.Cells.dll in order to export my reports in Excel format. I installed my program on my computer and some of my friends' it works fine, but today when I faced a clean computer(which has no .net framework or any programming frameworks), the installer installed the prerequisites (.Net Framework 3.5), and the program is launching, but when it comes to use the Aspose.Cells.dll it throws this exception:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.IO.FileLoadException: Could not load file or assembly 'Aspose.Cells, Version=5.2.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)
File name: 'Aspose.Cells, Version=5.2.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56' ---> System.Security.SecurityException: Strong name validation failed. (Exception from HRESULT: 0x8013141A)
The Zone of the assembly that failed was:
MyComputer
at PersonalTimeComputer.Code.MultiExporter.SelectedtoTpcXLS(List`1 selected, String xls_save_path, Dictionary`2 personList)
at PersonalTimeComputer.UI.PersonalTimeComputerForm.exportToolStripMenuItem_Click(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.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.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
PersonalTimeComputer
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Documents%20and%20Settings/Mehrazar/Desktop/Time%20Attendance/PersonalTimeComputer.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
SourceGrid
Assembly Version: 4.30.3817.19618
Win32 Version: 4.30.3817.19618
CodeBase: file:///C:/Documents%20and%20Settings/Mehrazar/Desktop/Time%20Attendance/SourceGrid.DLL
----------------------------------------
FarsiLibrary.Win
Assembly Version: 1.9.0.0
Win32 Version: 1.9.0.0
CodeBase: file:///C:/Documents%20and%20Settings/Mehrazar/Desktop/Time%20Attendance/FarsiLibrary.Win.DLL
----------------------------------------
FarsiLibrary.Resources
Assembly Version: 1.9.0.0
Win32 Version: 1.9.0.0
CodeBase: file:///C:/Documents%20and%20Settings/Mehrazar/Desktop/Time%20Attendance/FarsiLibrary.Resources.DLL
----------------------------------------
FarsiLibrary.Utils
Assembly Version: 1.9.0.0
Win32 Version: 1.9.0.0
CodeBase: file:///C:/Documents%20and%20Settings/Mehrazar/Desktop/Time%20Attendance/FarsiLibrary.Utils.DLL
----------------------------------------
Telerik.WinControls.GridView
Assembly Version: 2010.1.10.504
Win32 Version: 2010.1.10.0504
CodeBase: file:///C:/Documents%20and%20Settings/Mehrazar/Desktop/Time%20Attendance/Telerik.WinControls.GridView.DLL
----------------------------------------
Telerik.WinControls.UI
Assembly Version: 2010.1.10.504
Win32 Version: 2010.1.10.0504
CodeBase: file:///C:/Documents%20and%20Settings/Mehrazar/Desktop/Time%20Attendance/Telerik.WinControls.UI.DLL
----------------------------------------
Telerik.WinControls
Assembly Version: 2010.1.10.504
Win32 Version: 2010.1.10.0504
CodeBase: file:///C:/Documents%20and%20Settings/Mehrazar/Desktop/Time%20Attendance/Telerik.WinControls.DLL
----------------------------------------
TelerikCommon
Assembly Version: 2010.1.10.504
Win32 Version: 2010.1.10.0504
CodeBase: file:///C:/Documents%20and%20Settings/Mehrazar/Desktop/Time%20Attendance/TelerikCommon.DLL
----------------------------------------
System.Data
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
Accessibility
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
System.Xml.Linq
Assembly Version: 3.5.0.0
Win32 Version: 3.5.21022.8 built by: RTM
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml.Linq/3.5.0.0__b77a5c561934e089/System.Xml.Linq.dll
----------------------------------------
System.Core
Assembly Version: 3.5.0.0
Win32 Version: 3.5.21022.8 built by: RTM
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.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.
As you can see it has loaded all the other dlls but not this dll. Does this dll needs another prerequisite than .Net Framework 3.5?
Or is there any idea or some backward compatibility for this dll?
Thanks in Advance...
It looks like this is a signing issue. Aspose.Cells is a strong-named assembly, the error you're getting here means the CLR in the test machine is unable to find corresponding public key to verify the .dll's signature. It looks like you'll need to resign the assembly.
Previous post with a similar problem.