未处理 System.BadImageFormatException
Message="试图加载格式不正确的程序。 (异常来自 HRESULT:0x8007000B)"
Source="Kennedy.ManagedHooks"
StackTrace:
在 Kennedy.ManagedHooks.SystemHook.SetUserHookCallback(HookProcessedHandler hookCallback, HookTypes hookType)
在 Kennedy.ManagedHooks.SystemHook..ctor(HookTypes type) 位置 E:\C#毕业项目\浪潮卡拉ok点歌系统\SystemHooks\ManagedHooks\SystemHook.cs:行号 44
在 Kennedy.ManagedHooks.KeyboardHook..ctor() 位置 E:\C#毕业项目\浪潮卡拉ok点歌系统\SystemHooks\ManagedHooks\KeyboardHook.cs:行号 39
在 浪潮卡拉ok点歌系统.MainForm..ctor() 位置 D:\C#毕业项目\浪潮卡拉ok点歌系统\浪潮卡拉ok点歌系统\MainForm.cs:行号 121
在 浪潮卡拉ok点歌系统.LoginForm.picDengLu_Click(Object sender, EventArgs e) 位置 D:\C#毕业项目\浪潮卡拉ok点歌系统\浪潮卡拉ok点歌系统\LoginForm.cs:行号 151
在 System.Windows.Forms.Control.OnClick(EventArgs e)
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
在 浪潮卡拉ok点歌系统.Program.Main() 位置 D:\C#毕业项目\浪潮卡拉ok点歌系统\浪潮卡拉ok点歌系统\Program.cs:行号 18
在 System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()
---------------------------------------------------------
/// <include file='ManagedHooks.xml' path='Docs/SystemHook/ctor/*'/>
public SystemHook(HookTypes type)
{
_type = type; _processHandler = new HookProcessedHandler(InternalHookCallback);
SetCallBackResults result = SetUserHookCallback(_processHandler, _type);//异常
if (result != SetCallBackResults.Success)
{
this.Dispose();
GenerateCallBackException(type, result);
}
}未处理BadimageFormatException
试图加载格式不正确的程序.(异常来自HRESULT:0x8007000B)弄了个全局截取按键的 在xp上没问题...
Message="试图加载格式不正确的程序。 (异常来自 HRESULT:0x8007000B)"
Source="Kennedy.ManagedHooks"
StackTrace:
在 Kennedy.ManagedHooks.SystemHook.SetUserHookCallback(HookProcessedHandler hookCallback, HookTypes hookType)
在 Kennedy.ManagedHooks.SystemHook..ctor(HookTypes type) 位置 E:\C#毕业项目\浪潮卡拉ok点歌系统\SystemHooks\ManagedHooks\SystemHook.cs:行号 44
在 Kennedy.ManagedHooks.KeyboardHook..ctor() 位置 E:\C#毕业项目\浪潮卡拉ok点歌系统\SystemHooks\ManagedHooks\KeyboardHook.cs:行号 39
在 浪潮卡拉ok点歌系统.MainForm..ctor() 位置 D:\C#毕业项目\浪潮卡拉ok点歌系统\浪潮卡拉ok点歌系统\MainForm.cs:行号 121
在 浪潮卡拉ok点歌系统.LoginForm.picDengLu_Click(Object sender, EventArgs e) 位置 D:\C#毕业项目\浪潮卡拉ok点歌系统\浪潮卡拉ok点歌系统\LoginForm.cs:行号 151
在 System.Windows.Forms.Control.OnClick(EventArgs e)
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
在 浪潮卡拉ok点歌系统.Program.Main() 位置 D:\C#毕业项目\浪潮卡拉ok点歌系统\浪潮卡拉ok点歌系统\Program.cs:行号 18
在 System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()
---------------------------------------------------------
/// <include file='ManagedHooks.xml' path='Docs/SystemHook/ctor/*'/>
public SystemHook(HookTypes type)
{
_type = type; _processHandler = new HookProcessedHandler(InternalHookCallback);
SetCallBackResults result = SetUserHookCallback(_processHandler, _type);//异常
if (result != SetCallBackResults.Success)
{
this.Dispose();
GenerateCallBackException(type, result);
}
}未处理BadimageFormatException
试图加载格式不正确的程序.(异常来自HRESULT:0x8007000B)弄了个全局截取按键的 在xp上没问题...
解决方案 »
- VS项目的生成事件错误,如何忽略?
- 【求算法】关于C#字符串的问题。
- access 数据库的更新
- 关于数字字符串处理一个小问题(刚学C#)
- c#入门,请大家帮忙 ~
- 部署C#时,是否一定要安装.net Framework?
- 【散分调查】有多少人在用DevExpress V3的控件,盗版还是正版的,全套正版价格多少?
- 求教在网页上怎么嵌入excel,并对它进行操作。望大侠指点一二!
- 正则问题 sourceString = rep.Replace(sourceString," $1=$2" + replaceURL + "$3$4"); 中的," $1=$2" + "$3$4怎么理解啊
- 刚找到这个地方,请朋友们帮忙!.net安装问题
- 【求助】32位二进制转单精度浮点数问题
- 【高手进】webbrowser 多线程问题 急!
因为win7是64位的,System.Data.CTP.dll and System.Data.Entity.dll这两个dll是引用的系统的(MS上说这两个是混合形的,也就是说它可以在32位-x86上运行也可以在64位上运行,win7中默认是64),那么你可以在Win7中装个vs看看你这里的代码改一种方式写应该可以。如:
public static bool IsWindowsXP()
{
System.OperatingSystem os = System.Environment.OSVersion;
if (os.Platform == System.PlatformID.Win32NT && os.Version.Major == 5 && os.Version.Minor == 1)
{
return true;
}
else
{
return false;
}
}solution2:因为 System.Data.CTP.dll and System.Data.Entity.dll这两个dll是引用的系统的(MS上说这两个是混合形的,也就是说它可以在32位-x86上运行也可以在64位上运行,win7中默认是64, XP,Vista有32位和64位的),但是可以强制这些DLL以什么方式运行,在VS Project的的Build选项中的 "platform target",选择x86,这个我没试过。我想应该可行