简体   繁体   English

错误“msvcr100.dll”(仅限Windows 7和Vista)甚至静态链接后(/ MT)

[英]Error “msvcr100.dll” (only on Windows 7 & Vista) even AFTER statically linking (/MT)

I have a simple dll that is being injected into a target process using MS detours. 我有一个简单的dll,正在使用MS绕道注入目标进程。 The process doing the injecting is C# .net application. 执行注入的过程是C#.net应用程序。

Both the DLL and the detours library have been statically linked (/MT option). DLL和detours库都已静态链接(/ MT选项)。

However when I try to inject the dll into a target program on a client's machine I get error "msvcr100.dll" is missing" error. Now I open the dll w/ depends and there is no dependency on "msvcr100.dll". 但是,当我尝试将dll注入客户端计算机上的目标程序时,我收到错误“msvcr100.dll”缺少“错误。现在我打开dll w / depends并且不依赖于”msvcr100.dll“。

Even weirder this issue only happens when the client is vista x64 or windows 7 x64. 甚至更奇怪这个问题只发生在客户端是vista x64或windows 7 x64时。 The dll is successfully injected on windows xp x32 and windows 7 x32 systems. dll成功注入到windows xp x32和windows 7 x32系统上。

Any ideas on what bug in visual studio is indicating a dependency on a library not being used? 关于visual studio中哪些错误表明对未使用的库的依赖性的任何想法?

On edit: Looks like someone else had the same issue ... never resolved. 在编辑:看起来像其他人有同样的问题...从未解决。 Compiled .dll files requiring msvcr100.dll to load 编译.dll文件需要加载msvcr100.dll

For the record installing Visual studio 2010 C++ redistributable on client machine "solves" the issue however I hoped to avoid that dependency by statically linking. 对于记录安装Visual Studio 2010 C ++可再发行客户端机器“解决”问题,但我希望通过静态链接避免这种依赖。

You might be able to figure out what's going on my attaching (pre-injection) the cdb debugger to the process on a machine where msvcr100.dll is loaded (with the DLL installed). 你可能能够弄清楚我的附加(预注入)cdb调试器在加载了msvcr100.dll的机器上的进程(安装了DLL)。 Use the 使用

sxe ld:msvcr100

command to break when that DLL is loaded (I'm not 100% sure if that's the exactly correct syntax). 在加载DLL时断开命令(我不是100%确定这是否是完全正确的语法)。 Once it's loaded, you might be able to figure out why by looking at the call stack. 加载后,您可以通过查看调用堆栈来找出原因。 If not, try setting a breakpoint on everything in that module: 如果没有,请尝试在该模块中的所有内容上设置断点:

bm msvcr100!*

and see who's calling it. 看看谁在叫它。 That should give you a really good idea why it's being loaded. 这应该会让你非常清楚为什么它被加载。

So I never did discover exactly what the issue is but on a hunch I tried running the application (exact same build w/ mscvr100.dll error) on another Windows 7 machine and it worked fine. 所以我从来没有确切地发现问题是什么,但在预感到我试图在另一台Windows 7机器上运行应用程序(完全相同的构建w / mscvr100.dll错误),它工作正常。

I reinstalled Windows 7 on the "problem" machine and the same build works fine without error. 我在“问题”机器上重新安装了Windows 7,同样的构建工作正常,没有错误。 In my google searching I came across a report of another person having this issue after uninstalling Visual Studio. 在我的谷歌搜索中,我在卸载Visual Studio后遇到了另一个有此问题的人的报告。 I know for a fact that Visual Studio was installed on the "problem" Windows 7 machine at one time and was currently uninstalled. 我知道Visual Studio一次安装在“问题”Windows 7机器上并且当前已卸载。

If this happens to someone else I would recommend try running the binary on a machine that has never had visual studio installed. 如果这发生在其他人身上,我建议尝试在从未安装过visual studio的机器上运行二进制文件。 If it works without issue then likely there is some issue related to VS uninstall. 如果它没有问题,那么可能存在与VS卸载相关的一些问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM