C# 如何确定引用的是Microsoft.VC90.DebugCRT? 我有一个大型的Web应用程序,包括C语言、C++和C中的代码,有很多引用(项目引用,DLL引用),我正在发布版本。在虚拟机中测试程序时,会出现以下错误: Could not load file or assembly <MyAssembly.DLL> or one of its dependencies. The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.

C# 如何确定引用的是Microsoft.VC90.DebugCRT? 我有一个大型的Web应用程序,包括C语言、C++和C中的代码,有很多引用(项目引用,DLL引用),我正在发布版本。在虚拟机中测试程序时,会出现以下错误: Could not load file or assembly <MyAssembly.DLL> or one of its dependencies. The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.,c#,event-viewer,C#,Event Viewer,我还按照建议使用了sxstrace,结果得到一个文件,上面写着: ERROR: Cannot resolve reference Microsoft.VC90.DebugCRT,processorArchitecture="x86", publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8" 我检查了我的项目的配置,它们都设置为内置版本。为什么MyAssembly引用Microsoft.VC90.DebugCRT?

我还按照建议使用了sxstrace,结果得到一个文件,上面写着:

ERROR: Cannot resolve reference Microsoft.VC90.DebugCRT,processorArchitecture="x86",
publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8"
我检查了我的项目的配置,它们都设置为内置版本。为什么MyAssembly引用Microsoft.VC90.DebugCRT?我怎样才能修好它

请注意,我确实在虚拟机上安装了x86和x64 MSVC++可再发行文件

编辑 我还在MyAssembly.dll上运行了dependency walker,得到了一堆条目,上面写着“打开文件时出错。系统找不到指定的文件”:


正如在一些评论中提到的,一个解决方案是使用dependency walker


实际上,MyAssembly.dll是使用调试配置构建的,尽管我选择了在Visual Studio中发布。原因是我正在运行一个生成后事件,该事件在目标WebPublish上调用了msbuild,但它没有明确为此指定发布配置,所以它决定使用Debug。

dependency walker?在调试配置中,您使用了VS2008构建的C或C++代码。如果您不知道链接的.lib文件来自何处,就会发生这种情况。当然,我们也没有。您可以使用十六进制查看器查看.lib文件,并搜索字符串以缩小其范围。@DmitriSosnik我用depends的输出更新了问题。@HansPassant,是的,我以为发生了类似的事情。只是根本不知道如何解决这个问题。我想我会遵循你的建议。在dependency walker中,查看模块列表,找到MSVCR90D.dll,右键单击并选择“突出显示树中的匹配模块”。这应该允许您查看此模块需要什么exe或dll。
ERROR: Cannot resolve reference Microsoft.VC90.DebugCRT,processorArchitecture="x86",
publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8"
API-MS-WIN-... (4x)
EXT-MS-WIN-...
MSVCM90D.DLL
MSVCR90.DLL
MSVCR90D.DLL
IESHIMS.DLL
MFPLAT.DLL
SETTINGSYNPOLICY.DLL
WLANAPI.DLL