<legend id='3gpYv'><style id='3gpYv'><dir id='3gpYv'><q id='3gpYv'></q></dir></style></legend>
      <i id='3gpYv'><tr id='3gpYv'><dt id='3gpYv'><q id='3gpYv'><span id='3gpYv'><b id='3gpYv'><form id='3gpYv'><ins id='3gpYv'></ins><ul id='3gpYv'></ul><sub id='3gpYv'></sub></form><legend id='3gpYv'></legend><bdo id='3gpYv'><pre id='3gpYv'><center id='3gpYv'></center></pre></bdo></b><th id='3gpYv'></th></span></q></dt></tr></i><div id='3gpYv'><tfoot id='3gpYv'></tfoot><dl id='3gpYv'><fieldset id='3gpYv'></fieldset></dl></div>
      • <bdo id='3gpYv'></bdo><ul id='3gpYv'></ul>

    1. <tfoot id='3gpYv'></tfoot>
    2. <small id='3gpYv'></small><noframes id='3gpYv'>

    3. .NET 应用程序的链接器状态(又名“请先生,我可

      时间:2023-08-26

      <tfoot id='H9MeA'></tfoot>

      <legend id='H9MeA'><style id='H9MeA'><dir id='H9MeA'><q id='H9MeA'></q></dir></style></legend>
        • <bdo id='H9MeA'></bdo><ul id='H9MeA'></ul>

                <tbody id='H9MeA'></tbody>
                <i id='H9MeA'><tr id='H9MeA'><dt id='H9MeA'><q id='H9MeA'><span id='H9MeA'><b id='H9MeA'><form id='H9MeA'><ins id='H9MeA'></ins><ul id='H9MeA'></ul><sub id='H9MeA'></sub></form><legend id='H9MeA'></legend><bdo id='H9MeA'><pre id='H9MeA'><center id='H9MeA'></center></pre></bdo></b><th id='H9MeA'></th></span></q></dt></tr></i><div id='H9MeA'><tfoot id='H9MeA'></tfoot><dl id='H9MeA'><fieldset id='H9MeA'></fieldset></dl></div>
              • <small id='H9MeA'></small><noframes id='H9MeA'>

                本文介绍了.NET 应用程序的链接器状态(又名“请先生,我可以有一个链接器"2009 年版)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                这里的许多人可能都熟悉 Joel Spolsky 最受欢迎的博客文章之一,请先生,我可以有一个链接器,在那里他呼求一种方法来消除对 .NET 框架的依赖因此可以开发和销售独立的应用程序.

                Many people here are probably familiar with one of Joel Spolsky most popular blog posts, Please Sir, May I Have a Linker, where he cries out for a way to remove dependencies on the .NET framework so a stand-alone application can be developed and sold.

                Jason Zander 当时 Visual Studio 开发团队的回复 和他对这个话题的看法,认为这个话题有点没有实际意义——在运行时修复安全问题的能力(除其他外)是他们主要关心的问题.总的来说,小额开销是值得的.

                Jason Zander of the Visual Studio development team, at the time, replied with his views on the topic, arguing that the topic is somewhat moot - the ability to fix security problems in the runtime (among other points) was their chief concern. Overall, the small overhead was worth it.

                快进到 2009 年.现在有几个小组声称拥有 C# 链接器.(Jason Zander 甚至自己说实现一个并不需要太多.)我们现在有一个 200-300 mb 的跨平台完整 .NET 3.5 安装程序,而不是可爱的 .NET 1.0 十多万的下载包含适用于 x86、x64 和 ia64 的 .NET 版本.Microsoft 减少运行时大小的建议包括:

                Fast forward to 2009. There's a few groups out there now claiming to have C# linkers. (Jason Zander even said himself that it wouldn't take much to implement one.) Instead of the cute, dozen-so meg download of .NET 1.0, we now have a massive 200-300 mb cross-platform complete .NET 3.5 installer that contains versions of .NET for x86, x64, and ia64. Microsoft's suggestions to decrease the runtime size include:

                • 解压可再发行组件,删除不需要的目标平台,然后将其重新组合在一起
                • 使用仅为您的平台下载库的网络引导程序
                • 使用客户端配置文件安装程序(2008 年底新增),它的库有限且仅适用于 x86

                更糟糕的是,据我了解(如果我错了,请纠正我)客户端配置文件甚至没有在 Windows 中注册为安装了 .NET 3.5.这意味着如果在计算机上安装了多个 .NET 3.5 客户端应用程序,则不会互相看到,并且运行时将一次又一次地重新安装!

                To make matters worse, as I understand it (please correct me if I'm wrong) the client profile don't even register with windows as having .NET 3.5 installed. This means if multiple .NET 3.5 client applications are installed on the computer, none will see each other and the runtime will be re-installed again and again!

                我真的不知道微软在这里是怎么想的.即使假设最坏情况下的安装是针对一个目标平台(例如 x64)并且只需要包含那些库,您仍然会在应用程序上看到超过 60 mb 的开销.甚至最著名的 .NET 应用程序之一 Paint.NET 也充满了 由于大量 .NET 依赖项而导致安装应用程序的困难. 如果他们在分发免费应用程序时遇到问题,那么世界其他地方呢?最后,他们不得不 在他们可以安装自己的应用程序之前,制作一个安装了 Microsoft Installer 3.1、.NET 运行时引导程序和所有其他依赖库的引导程序.

                I really don't know what Microsoft is thinking here. Even assuming the worst case install will be for one target platform (eg, x64) and only those libraries need to be included, you're still looking at upwards of 60 mb overhead on your app. Even one of the most well known .NET apps, Paint.NET, was fraught with Difficulties installing the application because of the massive .NET dependencies. If THEY have problems distributing a free app, what about the rest of the world? In the end, they had to Make a bootstrapper that installed Microsoft Installer 3.1, the .NET runtime bootstrapper, and all their other dependent libraires before they could install their own application.

                那么怎么样.一个链接器.是否存在任何好的工具 - 或者是一种无需用户安装大量 .NET 运行时就可以简单地构建 C# 应用程序的工具?

                So how about it. A linker. Do any good ones exist - or a tool that simply makes it possible to build a C# application without requiring that the user install the massive .NET runtime?

                更新:所以,看起来有几个选项:

                Update: so, it looks like there's a couple of options:

                单声道:

                • Mono 有自己的链接器.从下面的答案来看,它看起来效果很好.
                • Mono has its own linker. From the answer below, it looks like it works pretty well.

                .NET:

                • Xenocode 似乎是可用且有效的.
                • Thinstall 是另一个被推荐的,它是由 VMware 推荐的.
                • Remotesoft 有另一个链接器.他们将其称为混淆器".有什么想法吗?
                • 由 Rustemsoft 发现另一个名为 Skater .NET Obfuscator.有谁熟悉他们?
                • 还建议使用 Microsoft 的 ILmerge;这看起来只执行部分任务(即合并库,而不是去除未使用的位).
                • Xenocode seems to be one that's available and works.
                • Thinstall is another that was recommended, and it's by VMware.
                • There's another linker by Remotesoft. They bill it as an 'obfuscator'. Any thoughts there?
                • Found another by Rustemsoft called Skater .NET Obfuscator. Anyone familiar with them?
                • ILmerge by Microsoft was also suggested; this looks like it only performs part of the task (ie, merging libraries, not stripping out unused bits).

                看起来 Mono 工具正在使用中;基于 .NET 的工具怎么样?与他们有任何其他经验,还是我们只需要等待 Microsoft 将其 3.5 推出给所有人?想到 .NET 4.0 需要多长时间才能推出,我不寒而栗……

                It looks like the Mono tools are getting use; how about the .NET based tools? Any other experience with them, or are we just going to have to wait for Microsoft to push it 3.5 out to everyone? I shudder to think how long it'll take for .NET 4.0 to be put out...

                推荐答案

                Mono Linker的案例.

                我不能过多谈论此处列出的其他软件,但作为 Mono Linker 的作者,我可以知道它做什么和不做什么.

                I can't talk much about the other pieces of software that are listed here, but as the author of the Mono Linker, I can tell what it does and what it does not.

                Mono 链接器只是一个托管链接器,因此根据定义,它需要程序集,并删除程序运行不需要的内容.它不会将所有程序集合并在一起,也不会用它们制作本机程序.

                The Mono Linker is only a managed linker, so by definition, it takes assemblies, and removes what's not necessary for a program to run. It doesn't merge assemblies all together, and it doesn't make a native program out of them.

                有一个 ILMerge 的 Mono.Merge 克隆,但它并不完整,它的作者也没有维护它.为了生成包含 Mono 运行时和程序集的本机程序,Mono 提供了 mkbundle 工具.

                There's a Mono.Merge clone of ILMerge, but it's not complete, and its author is not maintaining it. To generate a native program containing both the Mono runtime and assemblies, Mono provides the mkbundle tool.

                此外,由于它只是一个托管工具,它正在更改程序集,如果您为其提供强命名程序集,并且您没有私钥来签名它们,那么您将在运行这些程序集时遇到麻烦.

                Also, as it is only a managed tool, which is altering assemblies, if you give it strong named assemblies, and that you don't have the private keys to sign them back, you'll have troubles running those assemblies.

                我写了几篇关于链接器的博文:

                I wrote a couple of blog posts about the linker:

                • 链接器介绍
                • 链接器和mkbundle的结合使用

                关于我们使用 Linker 的体验.链接器目前用于 Mono 项目的两个部分.它用于生成我们分发的程序集,供人们嵌入我们的 C# 编译器 Mono.CSharp.dll.您可以在 PDC 上观看 Miguel 的演示,其中描述了我们如何做到这一点.它非常简单,它是 Linker 的基本用法,它是一个可定制的工具,并且很容易为其编写自定义步骤.

                About our experience with the Linker. The Linker is currently used in two parts of the Mono project. It's used to generate the assembly that we distribute for people to embed our C# compiler, Mono.CSharp.dll. You can watch Miguel's presentation at the PDC, which describes how we do that. It's pretty straightforward, and it's a basic usage of the Linker, which is a customizable tool, and it's pretty easy to write custom steps for it.

                链接器的一个更复杂的用途是我们创建我们的 Moonlight 程序集.Moonlight 是我们的 Silverlight 实现,程序集是桌面程序集的子集.因此,我们链接我们的桌面程序集以减小它们的大小,并使用自定义步骤,我们正在转换公共 API 以匹配 Silverlight 的.

                A more complex use of the Linker is the way we create our Moonlight assemblies. Moonlight being our implementation of Silverlight, the assemblies are a subset of the desktop assemblies. So we link our desktop assemblies to reduce their sizes, and using custom steps, we're transforming the public API to match Silverlight's.

                是的,链接器有一些非常粗糙的边缘,例如命令行界面,或者您必须真正知道自己在做什么这一事实,或者您最终可能会得到一些奇怪的程序集,但所有总而言之,它对我们非常有效.

                So yeah, the Linker has some pretty rough edges, such as the command line interface for instance, or the fact that you have to really know what you're doing, or you may end up with some weird assemblies, but all in all, it works really well for us.

                这篇关于.NET 应用程序的链接器状态(又名“请先生,我可以有一个链接器"2009 年版)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:“静态链接"和“动态链接"是什么意思? 下一篇:System.Web.Extensions 程序集无法解析

                相关文章

                最新文章

                <legend id='1Ccva'><style id='1Ccva'><dir id='1Ccva'><q id='1Ccva'></q></dir></style></legend>

                  <i id='1Ccva'><tr id='1Ccva'><dt id='1Ccva'><q id='1Ccva'><span id='1Ccva'><b id='1Ccva'><form id='1Ccva'><ins id='1Ccva'></ins><ul id='1Ccva'></ul><sub id='1Ccva'></sub></form><legend id='1Ccva'></legend><bdo id='1Ccva'><pre id='1Ccva'><center id='1Ccva'></center></pre></bdo></b><th id='1Ccva'></th></span></q></dt></tr></i><div id='1Ccva'><tfoot id='1Ccva'></tfoot><dl id='1Ccva'><fieldset id='1Ccva'></fieldset></dl></div>

                  <tfoot id='1Ccva'></tfoot>
                  • <bdo id='1Ccva'></bdo><ul id='1Ccva'></ul>

                  <small id='1Ccva'></small><noframes id='1Ccva'>