visual-studio C++/CLI 缺少 MSVCR90.DLL

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2993560/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 12:05:06  来源:igfitidea点击:

C++/CLI Missing MSVCR90.DLL

visual-studiovisual-studio-2010winapidependencies

提问by Mitch Freed

I have a c++/cli dll that I load at runtime and which works great in debug mode. If I try and load the dll in release mode it fails to load stating that one or more dependencies are missing. If I run depends against it I am missing MSVCR90.DLL from MSVCM90.DLL. If I check the debug version of the dll it also has the missing dependency, but against the debug (D) version.

我有一个在运行时加载的 c++/cli dll,它在调试模式下运行良好。如果我尝试在发布模式下加载 dll,它无法加载,说明缺少一个或多个依赖项。如果我运行依赖于它,我会从 MSVCM90.DLL 中丢失 MSVCR90.DLL。如果我检查 dll 的调试版本,它也有缺失的依赖项,但是针对调试 (D) 版本。

I have made sure debug/release embed the manifest file. I read something about there being issues with the app loading the dll being build as Any CPU and the dll being built as x86, but I don't see how to set them both to x86.

我已经确保调试/发布嵌入了清单文件。我读了一些关于加载正在构建为任何 CPU 的 dll 和正在构建为 x86 的 dll 的应用程序存在问题,但我不知道如何将它们都设置为 x86。

I am using VS2010.

我正在使用 VS2010。

Anyway, I've been messing around for a while now and have no idea what is wrong. I'm sure someone out there knows what is going on. Let me know if I need to include additional info.

无论如何,我已经乱搞了一段时间,不知道出了什么问题。我敢肯定有人知道发生了什么。如果我需要包含其他信息,请告诉我。

alt text http://www.freeimagehosting.net/uploads/fb31c0e256.png

替代文字 http://www.freeimagehosting.net/uploads/fb31c0e256.png

UPDATE:

更新:

This ended up being the resolution to my problem: http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/07794679-159b-4363-ae94-a68fe258d827

这最终成为我的问题的解决方案:http: //social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/07794679-159b-4363-ae94-a68fe258d827

回答by Jason Williams

MSVCR90 is the runtime for Visual Studio 2008. If you are running your application on your development PC, then you should have the debug and release runtimes installed (as part of Visual Studio) but it is possible something has gone awry with your install, or that VS2010 doesn't actually include the older runtimes. If you're trying to run the Release on a different PC, then it just needs the runtime installed.

MSVCR90 是 Visual Studio 2008的运行时。如果您在开发 PC 上运行您的应用程序,那么您应该安装调试和发布运行时(作为 Visual Studio 的一部分),但您的安装可能出现问题,或者 VS2010 实际上不包含较旧的运行时。如果您尝试在不同的 PC 上运行 Release,那么它只需要安装运行时。

Either way, you may be able to fix it by installing the Visual Studio 2008 redistributable- but make sure you get the right download for your PC (x86 or x64).

无论哪种方式,您都可以通过安装Visual Studio 2008 可再发行组件来修复它- 但请确保为您的 PC(x86 或 x64)获得正确的下载。

In previous versions of VS, you needed the runtime for the version you were compiling with, so if VS2010 follows this precedent you'd need MSVCR100, not MSVCR90 - which suggests that you may not have recompiled the dll with VS2010 - doing so may be another approach to get it running on your PC (using the redist that is in your VS2010 install) but beware that you will still need other users to install the appropriate (VS2010) redistributable on their PC.

在以前的 VS 版本中,您需要编译版本的运行时,因此如果 VS2010 遵循此先例,您将需要 MSVCR100,而不是 MSVCR90 - 这表明您可能没有使用 VS2010 重新编译 dll - 这样做可能是另一种让它在您的 PC 上运行的方法(使用 VS2010 安装中的 redist),但请注意,您仍然需要其他用户在他们的 PC 上安装适当的 (VS2010) 可再发行组件。

As for "Any CPU" versus "x86", this is a problem only on a 64-bit computer. On those systems a 64-bit application can't link dynamically to 32-bit dlls. If you compile your application as "Any CPU" it will be JIT compiled to be 64-bit on an 64-bit OS, so will crash if it tries to call any 32-bit dlls directly. THe solution is to build the application targeting "x86" as that forces the JIT compiler to generate 32-bit code (even on a 64-bit machine) and thus ensures compatibility with the dll you wish to call. If the DLL is a managed assembly, then you can use Any CPU on both the app an dll as they will both be JITted to the same format.

至于“Any CPU”与“x86”,这仅是 64 位计算机上的问题。在这些系统上,64 位应用程序无法动态链接到 32 位 dll。如果您将应用程序编译为“任何 CPU”,它将在 64 位操作系统上被 JIT 编译为 64 位,因此如果它尝试直接调用任何 32 位 dll,则会崩溃。解决方案是构建针对“x86”的应用程序,因为这会强制 JIT 编译器生成 32 位代码(即使在 64 位机器上),从而确保与您希望调用的 dll 兼容。如果 DLL 是托管程序集,那么您可以在应用程序和 dll 上使用 Any CPU,因为它们都将被 JIT 转换为相同的格式。

回答by Francisco Goldenstein

It happened to me something similar running a website in Vistual Studio 2012, after migrating from Visual Studio 2010. The error message was saying that MSVCR90.DLL was missing. The solution was: 1) Delete the folder _bindeployable located at the project path. 2) Rebuild.

从 Visual Studio 2010 迁移后,我在 Visual Studio 2012 中运行网站时发生了类似的事情。错误消息说缺少 MSVCR90.DLL。解决方法是:1) 删除位于项目路径的文件夹_bindeployable。2)重建。

I hope it helps.

我希望它有帮助。