【发布时间】:2011-04-27 01:54:52
【问题描述】:
未处理的异常:System.IO.FileLoadException:无法加载文件 或组装 'TheLibrary, Version=1.2.3905.36284, Culture=neutral, PublicKeyToken=14 04827c3a8f2601' 或其依赖项之一。 该 应用程序无法启动,因为它的并排配置 不正确。请参阅应用程序事件日志了解更多详细信息。 (HRESULT 例外:0x800736B1)文件名:'TheLibrary, 版本=1.2.3905.36284,文化=中性,PublicKe yToken=1404827c3a8f2601' ---> System.Runtime.InteropServices.COMException (0x800 736B1): 应用程序无法启动,因为它的并排配置 on 不正确。请参阅应用程序事件日志以获取更多详细信息。 (HRESULT 的异常:0x800736B1)
当我查看事件日志时,我得到了这个错误。
激活上下文生成失败 “C:\project\Debug\MyLibrary.dll”。从属程序集 Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8" 找不到。详细诊断请使用sxstrace.exe。
我使用sxstrace 记录错误,结果如下:
================= 开始生成激活上下文。输入参数:Flags = 0 ProcessorArchitecture = x86 CultureFallBacks = en-US;en ManifestPath = C:\Windows\system32\cmd.exe AssemblyDirectory = C:\Windows\system32\ 应用程序配置文件 = ----------------- 信息:解析清单文件 C:\Windows\system32\cmd.exe。信息:清单定义身份是 Microsoft.Windows.FileSystem.CMD,processorArchitecture="x86",type="win32",version="5.1.0.0"。 信息:激活上下文生成成功。结束激活上下文 一代。
================= 开始生成激活上下文。输入参数:Flags = 0 ProcessorArchitecture = x86 CultureFallBacks = en-US;en ManifestPath = C:\Debug\TheLibrary.dll AssemblyDirectory = C:\Debug\ 应用程序配置文件 = ----------------- 信息:解析清单文件 C:\Debug\TheLibrary.dll。信息:清单定义标识为(空)。信息:参考: Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8" INFO:解析参考 Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8"。 信息:正在解析 ProcessorArchitecture x86 的参考。信息: 解决文化中性的参考。信息:应用绑定 政策。 信息:未找到发布者政策。 信息:未找到绑定策略重定向。信息:开始装配探测。 信息:未在 WinSxS 中找到程序集。 信息:尝试在 C:\Windows\assembly\GAC_32\Microsoft.VC90.DebugCRT\9.0.21022.8__1fc8b3b9a1e18e3b\Microsoft.VC90.DebugCRT.DLL 处探测清单。 信息:尝试在 C:\Debug\Microsoft.VC90.DebugCRT.DLL 处探测清单。 信息:尝试在 C:\Debug\Microsoft.VC90.DebugCRT.MANIFEST 探测清单。 信息:尝试在 C:\Debug\Microsoft.VC90.DebugCRT\Microsoft.VC90.DebugCRT.DLL 处探测清单。 信息:尝试在 C:\Debug\Microsoft.VC90.DebugCRT\Microsoft.VC90.DebugCRT.MANIFEST 探测清单。 信息:未找到文化中性的清单。信息:末端装配探测。错误:无法解析参考 Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8"。 错误:激活上下文生成失败。结束激活上下文 一代。
无法解析引用Microsoft.VC90.DebugCRT,processorArchitecture=...
有什么想法吗?
【问题讨论】:
-
程序是用 VS 2008 构建的,我安装了 Microsoft Visual C++ 2008 Redistributable Package (x86)。但仍然没有帮助。
-
对于从 Google 到这里的非程序员,如果您在 Windows 完成启动之前启动程序,有时会发生此错误。如果您等待几秒钟并尝试再次启动该程序,那么之后它通常会正常工作。
标签: c# .net configuration dependencies