如果它是纯 MSIL (/clr:pure),我应该在应用程序目录中包含哪些 MSVCR dll?
我一直在网上搜索这方面的信息,但在没有找到未安装任何 CRT dll 的机器的情况下无法得出安全的结论。我的应用程序非常小,我不想给用户带来潜在的臃肿安装或下载他们不需要的东西的负担。
我很想在应用程序目录中包含 220kb msvcm90.dll(编译为 100% 纯 MSIL 代码的 C 运行时导入库。所有代码均符合 MSIL 的 ECMA URT 规范)和 2kb Microsoft.VC90.CRT.manifest。但是,http://msdn.microsoft。 com/en-us/library/abx4dbyh%28v=VS.90%29.aspx,指出这些现在存储在全局程序集缓存中。
有人可以验证我提出的解决方案吗?
这篇文章强化了我所说的很多内容,Visual C++ Redistributables 不使用 VCRedist_x86.exe,但虽然他有赞成票,但我仍然被以下声音所说服独立证词。
请答案参考我的清单,它只有一个依赖项:
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='idontknowenuff' />
</dependentAssembly>
</dependency>
由于这不仅仅指定托管运行时,因此如果没有完整安装(从 MS 下载 4Mb),我的解决方案似乎无法工作。
更复杂的是,我的 VC/redist 目录中的运行时版本是 9.0.30729.1,但我认为它将向后兼容。
I've been scouring the web for information on this and cannot come to a safe conclusion without finding a maching with none of the CRT dll's installed. My application is very small and I don't want to burden users with potentially bloated installs or the appearance of downloading stuff they don't need.
I'm tempted to just include the 220kb msvcm90.dll (C Runtime import library compiled as 100% pure MSIL code. All code complies with the ECMA URT spec for MSIL) and 2kb Microsoft.VC90.CRT.manifest in the application's directory. But , http://msdn.microsoft.com/en-us/library/abx4dbyh%28v=VS.90%29.aspx, states that those are now stored in the global assembly cache.
Can someone please verify my proposed solution?
A lot of what I've said is reinforced by this post, Visual C++ Redistributables without using VCRedist_x86.exe, but while he has upvotes I'm still to be convinced by the sound of independent testimony.
Please could answers make reference to my manifest which has just the one dependency:
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='idontknowenuff' />
</dependentAssembly>
</dependency>
As this doesn't specify just the managed runtime, it looks like my solution won't work without full installation (a 4Mb download from MS).
To further complicate things, the version of the runtime in my VC/redist directory is, 9.0.30729.1, but I assume it will be backwards compatible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您在调试器中运行(启用混合托管 + 本机调试),模块窗口应显示程序运行时加载的 DLL。
If you run in the debugger (enable mixed managed + native debugging), the modules window should show what DLLs get loaded while your program runs.
Google 图书出现:
“如果您通过 /clr 选项或 /clr:pure 选项编译使用 CRT 的代码,您将获得链接到而不是的本机中的适当的纯 MSIL CRT CRT”,Gordon Hogenson - 2006
这似乎是错误的,因为 ILDASM 将“.module extern MSVCR90.dll”显示为嵌入式清单的第一行。我将把这个答案留在这里供 GC 参考,或者作为提醒,并非所有发布的内容都是福音。
Google books turned up:
"If you compile code that uses the CRT with either the /clr option or the /clr:pure option, you'll get the appropriate pure MSIL CRT linked in instead of the native CRT", Gordon Hogenson - 2006
This seems wrong, as ILDASM shows ".module extern MSVCR90.dll" as the first line of the embedded manifest. I'll leave this answer here for GC or as a reminder that not everything that is published is gospel.