【发布时间】:2013-04-03 19:17:25
【问题描述】:
当我在我开发的计算机上运行我的应用程序时,它可以工作。当我在其他计算机上运行该应用程序时,我收到以下错误。
*****异常文本** ***** System.IO.FileNotFoundException:无法加载文件或程序集 'itextsharp,版本=5.4.0.0,文化=中性, PublicKeyToken=8354ae6d2174ddca' 或其依赖项之一。系统 não pode encontrar o arquivo especificado。文件名:'itextsharp, 版本=5.4.0.0,文化=中性,PublicKeyToken=8354ae6d2174ddca'
在 LoadImagesFromFolder.cc2215415.button3_Click_1(对象发送者, EventArgs e) 在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs 事件) 在 System.Windows.Forms.Control.WmMouseUp(消息和 m,鼠标按钮 按钮,Int32 点击)在 System.Windows.Forms.Control.WndProc(Message& m) 在 System.Windows.Forms.ButtonBase.WndProc(Message& m) 在 System.Windows.Forms.Button.WndProc(Message& m) 在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd,Int32 消息, IntPtr wparam, IntPtr lparam)警告:程序集绑定日志记录已关闭。启用程序集绑定 失败记录,设置注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) 为 1。注意:有 是与装配绑定失败相关的一些性能损失 记录。要关闭此功能,请删除注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog]。
***** 加载的程序集** ***** mscorlib 程序集版本:4.0.0.0 Win32版本:4.0.30319.296 (RTMGDR.030319-2900)
代码库:file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
LoadImagesFromFolder 程序集版本:1.0.0.0 Win32版本:1.0.0.0 代码库:file:///C:/Users/Felipe/Desktop/LoadImagesFromFolder.exe ---------------------------------------------------- System.Windows.Forms 程序集版本:4.0.0.0 Win32版本:4.0.30319.1002 构建者:RTMGDR 代码库:file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------------------- System.Drawing 程序集版本:4.0.0.0 Win32版本:4.0.30319.1001 构建者:RTMGDR 代码库:file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll - - - - - - - - - - - - - - - - - - - - 系统 程序集版本:4.0.0.0 Win32版本:4.0.30319.1001 构建者:RTMGDR
代码库:file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
***** JIT 调试 ** ***** 要启用即时 (JIT) 调试,此应用程序或计算机的 .config 文件 (machine.config) 必须在 system.windows.forms 部分。应用程序也必须编译 启用调试。
例如:
启用 JIT 调试后,任何未处理的异常都将发送到 在计算机上注册的 JIT 调试器,而不是由 这个对话框。
【问题讨论】:
-
我认为错误是不言自明的:
System.IO.FileNotFoundException: Could not load file or assembly 'itextsharp -
我知道...但是如何处理 itextsharp 负载?
-
错误说明了一切。您显然使用 ITextSharp ...它是包含在您的应用程序包中还是您希望用户自己获得它?下载它并将其放置在适当的位置(可能与您的应用程序相同的位置)或将其捆绑为您的软件包的一部分。
标签: c# winforms visual-studio