C# .NET Framework 4.5 Full Install 怎么只有 50MB(因为他们不再有 Client Profile)?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12978406/
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-08-10 01:11:40  来源:igfitidea点击:

How is the .NET Framework 4.5 Full Install only 50MB (since they don't have Client Profile anymore)?

c#.netvisual-studio-2010visual-studiovisual-studio-2008

提问by Ethan - SoldMySoulToMicrosoft

(all size references are in packaged size terms, not deployed/installed sizes)

(所有尺寸参考均为包装尺寸,而非部署/安装尺寸)

Basically, the previous .NET Framework 3.5 was a few hundred MB's in size (231.5 MB's), and the Client Profile didn't exist for 3.5, however, a Client Profile did exist for version 4.0 at only 41 MB is size, while the Full Install (not CP) for 4.0 was 48.1 MB's in size.

基本上,以前的 .NET Framework 3.5 大小为几百 MB(231.5 MB),并且 3.5 不存在客户端配置文件,但是,4.0 版本确实存在客户端配置文件,大小仅为 41 MB,而4.0 的完全安装(非 CP)大小为 48.1 MB。

Now, they are saying (in link posted at end of question) that most apps tended to need classes and namespaces that were not covered in the Client Profile 4.0, so they decided to not do a Client Profile for 4.5 for that reason. The other reason they quoted was that since they were able to get the Full Install version of the .NET Framework 4.5 down to 50 MB's, that also reduced the need of creating a Client Profile version (since .NET 4.5 Full Install is only 9 MB's greater than the .NET 4.0 Client Profile), and only 1. MB's greater than the equivalent Full Install (Standalone Offline Installer).

现在,他们说(在问题末尾发布的链接中)大多数应用程序往往需要 Client Profile 4.0 中未涵盖的类和命名空间,因此出于这个原因,他们决定不为 4.5 创建 Client Profile。他们引用的另一个原因是,由于他们能够将 .NET Framework 4.5 的完整安装版本减少到 50 MB,这也减少了创建客户端配置文件版本的需要(因为 .NET 4.5 完整安装只有 9 MB大于 .NET 4.0 客户端配置文件),并且仅比等效的完全安装(独立脱机安装程序)大 1. MB。

Now, my question really just has two parts, as follows:

现在,我的问题实际上只有两个部分,如下所示:

1). How on earth (excuse my enthusiasm) how can the 3.5 and below (3.0, 2.0) versions be several hundred MB's in size, when the 4.0 & 4.5 versions have fixed so many issues in 3.5 and below, and have added so many features since 3.5 and below, while being several times smaller in packaged size?

1)。到底怎么(原谅我的热情)3.5 及以下(3.0、2.0)版本怎么会有几百 MB 的大小,当 4.0 和 4.5 版本在 3.5 及以下版本中修复了如此多的问题并添加了如此多的功能时3.5 及以下版本,同时封装尺寸小几倍?

2). Is this the final word on the Client Profile, or may we see one for .NET 4.5 someday?

2)。这是客户端配置文件的最后一句话,还是有一天我们会看到 .NET 4.5 的内容?

3). How can 4.5 be only 1.9 MB's greater than 4.0 while fixing so man issues, and adding so many features?

3)。4.5 怎么会比 4.0 大 1.9 MB,同时解决了很多人的问题,并添加了这么多功能?

Update:(and potential 4th question to anyone willing):

更新:(以及任何愿意的人的潜在第四个问题):

@Gromer raised an interesting point, that language packs aren't included. Since their needs to be 1 language included, I'm assuming it's English and that is the default? If this is so, how is an average internet user meant to download and install language packs for their own use and language when most people don't even know/understand what a ".NET Framework" is? Am I missing something or is this not important? How often does the framework communicate to the end user in spoken language or dialog boxes?

@Gromer 提出了一个有趣的观点,即不包括语言包。由于他们需要包含 1 种语言,我假设它是英语,这是默认设置?如果是这样,当大多数人甚至不知道/理解什么是“.NET Framework”时,普通互联网用户如何下载和安装用于自己使用和语言的语言包?我错过了什么还是这不重要?框架多久通过口语或对话框与最终用户沟通?

The article where I got some of this information is below:

我获得其中一些信息的文章如下:

http://blogs.msdn.com/b/dotnet/archive/2012/10/12/improvements-in-net-framework-setup-for-developers-it-pros-and-users.aspx

http://blogs.msdn.com/b/dotnet/archive/2012/10/12/improvements-in-net-framework-setup-for-developers-it-pros-and-users.aspx

回答by Robert Harvey

Scott Hanselman puts it eloquently:

Scott Hanselman 雄辩地说:

Why is that one installer so big?

That giant .NET download is for one thing - It's meant for developers or administrators who might want to redistribute a a setup that contains not just the whole of the .NET Framework, but for all possible platforms. It has installers for x86, x64 and ia64.

为什么那个安装程序这么大?

那个巨大的 .NET 下载是为了一件事 - 它适用于可能想要重新分发不仅包含整个 .NET Framework 还包含所有可能平台的安装程序的开发人员或管理员。它具有适用于 x86、x64 和 ia64 的安装程序。

http://www.hanselman.com/blog/SmallestDotNetOnTheSizeOfTheNETFramework.aspx

http://www.hanselman.com/blog/SmallestDotNetOnTheSizeOfTheNETFramework.aspx

And:

和:

There's been some confusion about the size of the .NET Framework. The .NET Framework is not really a 200+ meg download.

Which installer do I use? Here's the whole thing in a nutshell for Developers, ISVs, and Administrators.

  • Offline Installer - One single file that can be run offline and can install the .NET Framework any system it's run on. It's complete, all platforms, installable offline.

  • Online Installer - A 2.7 meg setup program that will detect what just the files you need, then go download between 10 and 60 megs.

关于 .NET Framework 的大小存在一些混淆。 .NET Framework 并不是真正的 200 多兆下载。

我使用哪个安装程序?这是开发人员、ISV 和管理员的简而言之的全部内容。

  • 脱机安装程序 - 一个可以脱机运行的单个文件,可以在任何系统上安装 .NET Framework。它是完整的,所有平台,可离线安装。

  • 在线安装程序 - 一个 2.7 兆安装程序,它将检测您需要的文件,然后在 10 到 60 兆之间下载。

This blog postgoes into detail about how Microsoft made the .NET 4 framework platform installation smaller. Specifically:

这篇博文详细介绍了 Microsoft 如何使 .NET 4 框架平台安装更小。具体来说:

We determined the subset of framework functionality that was used by 95+% of client applications and produced a first class package for this scenario. The result of this is that, unless you are taking advantage of features such as ASP.NET, you can now take a dependency on a smaller framework.

我们确定了 95% 以上的客户端应用程序使用的框架功能子集,并为此场景生成了一流的包。这样做的结果是,除非您正在利用 ASP.NET 等功能,否则您现在可以依赖于较小的框架。

回答by Justin

I can't find a source for this, but I believe the reason why the .Net framework 3.5 installer was so big is because it contained pre-JITed versions of all assemblies (including in some cases ones which won't be used as they are targetted at the incorrect platform), wheras the .Net 4.0 installer doesn't - it JITs them at install time (this is why the installation of the .Net framework v4.0 takes so long)

我找不到这方面的来源,但我相信 .Net framework 3.5 安装程序如此庞大的原因是因为它包含所有程序集的预 JIT 版本(包括在某些情况下不会被使用的程序集)是针对不正确的平台),而 .Net 4.0 安装程序没有 - 它在安装时对它们进行 JIT(这就是 .Net 框架 v4.0 的安装需要这么长时间的原因)

I also recall being told that the .Net 4.5 installation will be muchquicker as rather than JITing assemblies as part of installation it will JIT them in the background while the PC is idle (however there is a process to immediately JIT assemblies that an application attempts to load, however haven't been JITed yet)

我还记得被告知,在.NET 4.5的安装将是多大的,而不是JIT编译组件在安装过程中,将JIT他们在后台,而PC处于闲置状态更快(但没有立即JIT组件的过程,一个应用程序尝试加载,但还没有被 JITed)

I'm struggling to find any sources for this at the moment however I'll post them when I find them.

我目前正在努力寻找任何来源,但是当我找到它们时我会发布它们。

回答by ZeroCool

My personal opinion is that with time evolving, Microsoft integrates more and more features of the core .NET Framework directly into the Windows Operating Systems by means of Service Packs and new Windows releases.

我个人的观点是,随着时间的推移,Microsoft 通过 Service Pack 和新的 Windows 版本将核心 .NET Framework 的越来越多的功能直接集成到 Windows 操作系统中。

I believe, that they redesigned the Operating System bindings in V 4.0, so the code base and the additional resources required to get .NET up and running decreases for the supported operating systems. E.g. all the XP special editions were removed from the support list between 3.5 and 4.0. In 4.5 the OS base is shrinking even more (Vista/7/Win8 and Server 2008/2013).

我相信,他们在 V 4.0 中重新设计了操作系统绑定,因此对于支持的操作系统来说,启动和运行 .NET 所需的代码库和额外资源减少了。例如,从 3.5 到 4.0 之间的支持列表中删除了所有 XP 特殊版本。在 4.5 中,操作系统基础进一步缩小(Vista/7/Win8 和 Server 2008/2013)。

Also like mentioned above features like languages except english were trimmed out and some other features were extracted to the .NET SDK package.

也像上面提到的功能,如除英语之外的语言被修剪掉,其他一些功能被提取到 .NET SDK 包中。

Just my two cents.

只有我的两分钱。

回答by Luke

If you look inside a 3.5 "standalone" installer you will be stunned finding how many sub-setups are there.

如果您查看 3.5“独立”安装程序的内部,您会惊讶地发现那里有多少子设置。

Take for instance dotnetfx35_with_sp1.exe: it is a big 231MB chained installer. When you decompress it with

dotnetfx35_with_sp1.exe为例:它是一个 231MB 的大链接安装程序。当你用

dotnetfx35_with_sp1.exe /x:myfolder

you get a 240Mb folder, split on several other folders:

你会得到一个 240Mb 的文件夹,分成几个其他文件夹:

dotNetMSP [111.2Mb] ==> x64 [45.0Mb], ia64 [36.2Mb], x86 [29.7Mb], [other] 300k 
dotNetFX20 [47.6Mb] ==> about 50/50% between 32 and 64 bit
dotNetFX30 [46.8Mb] ==> x64 [24Mb], x86 [22Mb]
dotNetFX35 [31.5Mb] ==> ia64 [12.8Mb], x64 [10.8Mb], x86 [7.7Mb]
...and some other files around...

As you know, .NET 3.5 requires .NET 3.0 and .NET 2.0, which is exactly what you see here.. Even without including language packs, they had to target a number of different platforms (from windows XP onwards) and to include a lot of patches.

如您所知,.NET 3.5 需要 .NET 3.0 和 .NET 2.0,这正是您在此处看到的。即使不包含语言包,它们也必须针对许多不同的平台(从 Windows XP 开始)并包含一个很多补丁。

Moving forward to .NET 4.x, those dependencies on previous frameworks have been dropped and, on the same time, they support fewer (and newer) operating systems and platforms (take for instance ia64 support - which was quite heavy on file size - and is now almost disappeared).

向 .NET 4.x 迈进,对以前框架的依赖已被删除,同时,它们支持更少(和更新)的操作系统和平台(例如 ia64 支持 - 这对文件大小的影响非常大)现在几乎消失了)。

From what I see on newer setups, they also might have changed something on the internal format in which they ship the framework, probably one more efficiently compressed..

从我在较新的设置中看到的情况来看,他们也可能对交付框架的内部格式进行了一些更改,可能是一种更有效的压缩方式。

Last but not least, they changed many inner architectures, rewrote grounds-up a lot of things, which in turn probably let them remove other old things...

最后但并非最不重要的是,他们改变了许多内部架构,重新编写了很多东西,这反过来可能让他们删除了其他旧东西......

There is probably not a single extraordinary change that let them drop the size so much: probably all of the above and more :)

可能没有一个特别的变化让他们如此缩小尺寸:可能以上所有以及更多:)

Just my 2c :)

只是我的 2c :)