日期:2014-05-18  浏览次数:21053 次

Microsoft WCF 服务主机
WcfSvcHost 遇到一个关键错误,必须退出。这可能是由无效的配置文件引起的。有关详细信息,请检查以下其他信息。

System.BadImageFormatException: 未能加载文件或程序集“file:///G:\MccnBusinessSystem\Mccn.BusinessSystem\mccn.WCFBusinessEntity\bin\Debug\mccn.WCFBusinessEntity.dll”或它的某一个依赖项。试图加载格式不正确的程序。
文件名:“file:///G:\MccnBusinessSystem\Mccn.BusinessSystem\mccn.WCFBusinessEntity\bin\Debug\mccn.WCFBusinessEntity.dll”
  在 System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
  在 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
  在 System.Reflection.Assembly.Load(AssemblyName assemblyRef)
  在 Microsoft.Tools.SvcHost.ServiceHostHelper.LoadServiceAssembly(String svcAssemblyPath)

=== 预绑定状态信息 ===
日志: 用户 = huanglin-PC\huanglin
日志: Where-ref 绑定。位置 = G:\MccnBusinessSystem\Mccn.BusinessSystem\mccn.WCFBusinessEntity\bin\Debug\mccn.WCFBusinessEntity.dll
日志: Appbase = file:///G:/MccnBusinessSystem/Mccn.BusinessSystem/mccn.WCFBusinessEntity/bin/Debug
日志: 初始 PrivatePath = NULL
调用程序集: (Unknown)。
===
日志: 此绑定从 LoadFrom 加载上下文开始。
警告: 将不在 LoadFrom 上下文中探测本机映像。仅在默认加载上下文中探测本机映像,例如,使用 Assembly.Load()。
日志: 正在使用应用程序配置文件: G:\MccnBusinessSystem\Mccn.BusinessSystem\mccn.WCFBusinessEntity\bin\Debug\mccn.WCFBusinessEntity.dll.config
日志: 使用主机配置文件: 
日志: 使用 C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config 的计算机配置文件。
日志: 尝试下载新的 URL file:///G:/MccnBusinessSystem/Mccn.BusinessSystem/mccn.WCFBusinessEntity/bin/Debug/mccn.WCFBusinessEntity.dll。
错误: 未能完成程序集的安装(hr = 0x8007000b)。探测终止。


------解决方案--------------------
探讨

引用:
是不是依赖的DLL中有编译成64位的。


我的机器就是64位的。