C#未能加载文件或程序集 需要怎么解决?试下项目==>属性==》生成==》目标平台===》x86 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 文件是存在的,我找到那个位置了,你看看system这个引用的属性,是2.0.0.0,为什么他要去找版本是4.0.0.0的那个? 需要怎么解决?试下项目==>属性==》生成==》目标平台===》x86还是报那个错误 你查看你的项目的属性,看看当前用的是什么 .NET Framework。我遇到过,就是你项目当前的 Framework 和你引用的 DLL 版本对不起来导致的。 我属性里面用的是.NET Framework 3.5 右击 project-> property->build->platform target(anycpu x86 x64三种) 我属性里面用的是.NET Framework 3.5你把它改成 2.0 试试呢? 我属性里面用的是.NET Framework 3.5你把它改成 2.0 试试呢?换成2.0有些包就引不进去了。。有叹号了,, 我属性里面用的是.NET Framework 3.5那当然加载不了4.0的dll啦把项目改成4.0的 有关调用实时(JIT)调试而不是此对话框的详细信息,请参见此消息的结尾。************** 异常文本 **************System.IO.FileLoadException: 未能加载文件或程序集“System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)文件名:“System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089” 在 WfmFastReport.Form1.button2_Click_1(Object sender, EventArgs e) 在 System.Windows.Forms.Control.OnClick(EventArgs e) 在 System.Windows.Forms.Button.OnClick(EventArgs e) 在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) 在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) 在 System.Windows.Forms.Control.WndProc(Message& m) 在 System.Windows.Forms.ButtonBase.WndProc(Message& m) 在 System.Windows.Forms.Button.WndProc(Message& m) 在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) 在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)警告: 程序集绑定日志记录被关闭。要启用程序集绑定失败日志记录,请将注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD)设置为 1。注意: 会有一些与程序集绑定失败日志记录关联的性能损失。要关闭此功能,请移除注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog]。************** 已加载的程序集 **************mscorlib 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.6413 (Win8RTMGDR.050727-6400) 基本代码: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll----------------------------------------mscorlib.resources 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.6413 (Win8RTMGDR.050727-6400) 基本代码: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll----------------------------------------WfmFastReport 程序集版本: 1.0.0.0 Win32 版本: 1.0.0.0 基本代码: file:///C:/Users/g/Documents/Visual%20Studio%202008/Projects/WfmFastReport/WfmFastReport/bin/Release/WfmFastReport.exe----------------------------------------System.Windows.Forms 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.6402 (Win8RTMGDR.050727-6400) 基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll----------------------------------------System 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.6417 (Win8RTMGDR.050727-6400) 基本代码: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll----------------------------------------System.Drawing 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.6401 (Win8RTMGDR.050727-6400) 基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll----------------------------------------FastReport 程序集版本: 2013.2.5.0 Win32 版本: 基本代码: file:///C:/Users/g/Documents/Visual%20Studio%202008/Projects/WfmFastReport/WfmFastReport/bin/Release/FastReport.DLL----------------------------------------System.Windows.Forms.resources 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.6400 (Win8RTMGDR.050727-6400) 基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_zh-CHS_b77a5c561934e089/System.Windows.Forms.resources.dll----------------------------------------System.Xml 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.6411 (Win8RTMGDR.050727-6400) 基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll----------------------------------------************** JIT 调试 **************要启用实时(JIT)调试,该应用程序或计算机的 .config 文件(machine.config)的 system.windows.forms 节中必须设置jitDebugging 值。编译应用程序时还必须启用调试。例如: <configuration> <system.windows.forms jitDebugging="true" /></configuration>启用 JIT 调试后,任何无法处理的异常都将被发送到在此计算机上注册的 JIT 调试器,而不是由此对话框处理。 我属性里面用的是.NET Framework 3.5你把它改成 2.0 试试呢?换成2.0有些包就引不进去了。。有叹号了,,那你就把那些 2.0 版本的 DLL 删掉,重新引用,删掉的记下来,别到时候漏掉。 === 预绑定状态信息 ===日志: 用户 = VAIOH\g日志: DisplayName = System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 (Fully-specified)日志: Appbase = file:///C:/Users/g/Documents/Visual Studio 2008/Projects/WfmFastReport/WfmFastReport/bin/Release/日志: 初始 PrivatePath = NULL调用程序集: FastReport, Version=2013.2.5.0, Culture=neutral, PublicKeyToken=null。===日志: 此绑定从 default 加载上下文开始。日志: 未找到应用程序配置文件。日志: 使用 C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config 的计算机配置文件。日志: 策略后引用: System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089日志: 试图下载新的 URL file:///C:/Users/g/Documents/Visual Studio 2008/Projects/WfmFastReport/WfmFastReport/bin/Release/System.DLL。警告: 比较程序集名称时发生不匹配: 主版本错误: 未能完成程序集的安装(hr = 0x80131040)。探测终止。 我觉得你应该是引用的第三方的 DLL 版本高了。你用到的第三方控件是高版本的 .NET 做的,你为什么要用低版本的 VS 去做?这本来就是不合理的,你应该用高版本的 VS 去创建项目并引用 DLL,如果第三方 DLL 够正规,应该有相应的多版本的 DLL。 卸载程序报出:性能类别未注册或属于系统类别,因此无法删除此类别。 另开一帖,socket无响应服务器端挂死 用vs2008编译csharp源代码时如何加命令开关? windows窗体启动顺序 如何在图片上的某个区域点击打开窗口? 求正则获取页面中的链接的问题! sql语句 学习.net的困惑?? log4ent 求助:web连接oracle问题,急! WPF使用ControlTemplate后,设计视图和实际运行结果不一致 C# CANopen协议 伺服电机
试下项目==>属性==》生成==》目标平台===》x86
还是报那个错误
你把它改成 2.0 试试呢?
你把它改成 2.0 试试呢?
换成2.0有些包就引不进去了。。有叹号了,,
那当然加载不了4.0的dll啦
把项目改成4.0的
请参见此消息的结尾。************** 异常文本 **************
System.IO.FileLoadException: 未能加载文件或程序集“System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)
文件名:“System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”
在 WfmFastReport.Form1.button2_Click_1(Object sender, EventArgs e)
在 System.Windows.Forms.Control.OnClick(EventArgs e)
在 System.Windows.Forms.Button.OnClick(EventArgs e)
在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ButtonBase.WndProc(Message& m)
在 System.Windows.Forms.Button.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)警告: 程序集绑定日志记录被关闭。
要启用程序集绑定失败日志记录,请将注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD)设置为 1。
注意: 会有一些与程序集绑定失败日志记录关联的性能损失。
要关闭此功能,请移除注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog]。************** 已加载的程序集 **************
mscorlib
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.6413 (Win8RTMGDR.050727-6400)
基本代码: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
mscorlib.resources
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.6413 (Win8RTMGDR.050727-6400)
基本代码: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
WfmFastReport
程序集版本: 1.0.0.0
Win32 版本: 1.0.0.0
基本代码: file:///C:/Users/g/Documents/Visual%20Studio%202008/Projects/WfmFastReport/WfmFastReport/bin/Release/WfmFastReport.exe
----------------------------------------
System.Windows.Forms
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.6402 (Win8RTMGDR.050727-6400)
基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.6417 (Win8RTMGDR.050727-6400)
基本代码: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.6401 (Win8RTMGDR.050727-6400)
基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
FastReport
程序集版本: 2013.2.5.0
Win32 版本:
基本代码: file:///C:/Users/g/Documents/Visual%20Studio%202008/Projects/WfmFastReport/WfmFastReport/bin/Release/FastReport.DLL
----------------------------------------
System.Windows.Forms.resources
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.6400 (Win8RTMGDR.050727-6400)
基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_zh-CHS_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------
System.Xml
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.6411 (Win8RTMGDR.050727-6400)
基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------************** JIT 调试 **************
要启用实时(JIT)调试,
该应用程序或计算机的 .config 文件(machine.config)的 system.windows.forms 节中必须设置
jitDebugging 值。
编译应用程序时还必须启用
调试。例如: <configuration>
<system.windows.forms jitDebugging="true" />
</configuration>启用 JIT 调试后,任何无法处理的异常
都将被发送到在此计算机上注册的 JIT 调试器,
而不是由此对话框处理。
你把它改成 2.0 试试呢?
换成2.0有些包就引不进去了。。有叹号了,,
那你就把那些 2.0 版本的 DLL 删掉,重新引用,删掉的记下来,别到时候漏掉。
日志: 用户 = VAIOH\g
日志: DisplayName = System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
(Fully-specified)
日志: Appbase = file:///C:/Users/g/Documents/Visual Studio 2008/Projects/WfmFastReport/WfmFastReport/bin/Release/
日志: 初始 PrivatePath = NULL
调用程序集: FastReport, Version=2013.2.5.0, Culture=neutral, PublicKeyToken=null。
===
日志: 此绑定从 default 加载上下文开始。
日志: 未找到应用程序配置文件。
日志: 使用 C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config 的计算机配置文件。
日志: 策略后引用: System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
日志: 试图下载新的 URL file:///C:/Users/g/Documents/Visual Studio 2008/Projects/WfmFastReport/WfmFastReport/bin/Release/System.DLL。
警告: 比较程序集名称时发生不匹配: 主版本
错误: 未能完成程序集的安装(hr = 0x80131040)。探测终止。