C#Aspose.Cells.dll安装错误

我最近使用C#编写了一个程序,并使用Aspose.Cells.dll以Excel格式导出报告。我在我的电脑上安装了我的程序,一些朋友的工作正常,但今天当我遇到一台干净的电脑(没有.net框架或任何编程框架)时,安装程​​序安装了必备软件(.Net Framework 3.5),并且该程序正在启动,但是在使用Aspose.Cells.dll时会引发此异常:

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:


    


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.     

正如你可以看到它已经加载了所有其他DLL但不是这个DLL。这个dll是否需要比.Net Framework 3.5更多的先决条件?

或者有没有这个DLL的任何想法或一些向后兼容?

提前致谢...

0
额外 编辑
意见: 1

1 答案

看起来这是一个签名问题。 Aspose.Cells是一个强名称的程序集,您在这里得到的错误意味着测试机器中的CLR无法找到相应的公钥来验证.dll的签名。看起来您需要退出程序集

以前的帖子有类似的问题。

0
额外
我认为我的问题也是由于签署,但我怎么能再次签署我的dll我没有从帖子中得到我怎么能这样做是可以通过C#?还是其他什么?
额外 作者 Ehsan,
当我去我的DLL的属性它说它有一个数字签名,它是无效的,它导致了问题
额外 作者 Ehsan,
如果这就是你要求的,可以通过Visual Studio签署一个库。如果您从源代码构建.dll,则可以按项目上的Alt + Enter(或右键单击,然后单击属性),然后转到“签名”选项卡。验证复选框“签署程序集”是否被选中,并选择强名称密钥文件。 (同时确保“仅延迟标志”未选中)。如果您没有源代码,您将不得不退出.dll。在这篇文章中有一些链接来提供帮助。
额外 作者 Morrison,