如果它是纯 MSIL (/clr:pure),我应该在应用程序目录中包含哪些 MSVCR dll?

发布于 2024-12-05 15:11:23 字数 1104 浏览 1 评论 0原文

我一直在网上搜索这方面的信息,但在没有找到未安装任何 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 技术交流群。

扫码二维码加入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.

顾铮苏瑾 2024-12-12 15:11:23

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文