C# BCL(基类库)与 FCL(框架类库)

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

BCL (Base Class Library) vs FCL (Framework Class Library)

c#.netterminology

提问by Joan Venge

What's the difference between the two? Can we use them interchangeably?

两者有什么区别?我们可以互换使用它们吗?

回答by Joshua Belden

The BCL is a subset of the FCL. BCL honors the ECMA specification for the common language infrastructure. Then Microsoft added all their goodness like data and xml and called it the Framework Class Library. Basically they took the BCL and made it go to 11!

BCL 是 FCL 的一个子集。BCL 遵守 ECMA 通用语言基础架构规范。然后微软添加了他们所有的优点,比如数据和 xml,并将其称为框架类库。基本上他们拿了 BCL 并让它升到了 11!

回答by Andrew Webb

The Base Class Library (BCL) is literally that, the base. It contains basic, fundamental types like System.Stringand System.DateTime.

基类库 (BCL) 从字面上看就是基础。它包含基本的、基本的类型,如System.StringSystem.DateTime

The Framework Class Library (FCL) is the wider library that contains the totality: ASP.NET, WinForms, the XML stack, ADO.NET and more. You could say that the FCL includes the BCL.

框架类库 (FCL) 是更广泛的库,包含以下所有内容:ASP.NET、WinForms、XML 堆栈、ADO.NET 等。您可以说 FCL 包括 BCL。

回答by Chris S

BCL:

BCL:

A .NET Framework library, BCL is the standard for the C# runtime library and one of the Common Language Infrastructure (CLI) standard libraries. BCL provides types representing the built-in CLI data types, basic file access, collections, custom attributes, formatting, security attributes, I/O streams, string manipulation, and more.

作为 .NET Framework 库,BCL 是 C# 运行时库的标准,也是公共语言基础结构 (CLI) 标准库之一。BCL 提供了表示内置 CLI 数据类型、基本文件访问、集合、自定义属性、格式、安全属性、I/O 流、字符串操作等的类型。

FCL:

整箱

The .NET Framework class library is exactly what its name suggests: a library of classes and other types that developers can use to make their lives easier. While these classes are themselves written in C#, they can be used from any CLRbased language

.NET Framework 类库正如其名称所暗示的那样:开发人员可以使用这些类和其他类型的库来简化他们的工作。虽然这些类本身是用 C# 编写的,但它们可以从任何基于 CLR 的语言中使用

You'll be using the BCL with some parts of the FCL with each project type. So System.Windows.Forms (a separate library) or System.Web, with the BCL from mscorlib and System.dll

您将在每个项目类型的 FCL 的某些部分中使用 BCL。所以 System.Windows.Forms(一个单独的库)或 System.Web,以及来自 mscorlib 和 System.dll 的 BCL

回答by Praveen Prajapati

The Base Class Library (BCL) is the core set of classes that serve as the basic API of the Common Language Runtime. The classes in mscorlib.dll and some of the classes in System.dll and System.core.dll are considered to be a part of the BCL. It includes the classes in namespaces like System , System.Diagnostics , System.Globalization, System.Resources , System.Text , System.Runtime.Serialization and System.Data etc.

基类库 (BCL) 是一组核心类,用作公共语言运行时的基本 API。mscorlib.dll 中的类以及 System.dll 和 System.core.dll 中的一些类被认为是 BCL 的一部分。它包括 System 、 System.Diagnostics 、 System.Globalization 、 System.Resources 、 System.Text 、 System.Runtime.Serialization 和 System.Data 等命名空间中的类。

The Framework Class Library (FCL) is a superset of the BCL classes and refers to the entire class library that ships with .NET Framework. It includes an expanded set of libraries, including Windows Forms, ADO.NET, ASP.NET, Language Integrated Query, Windows Presentation Foundation, Windows Communication Foundation among others.

框架类库 (FCL) 是 BCL 类的超集,是指 .NET Framework 附带的整个类库。它包括一组扩展的库,包括 Windows Forms、ADO.NET、ASP.NET、Language Integrated Query、Windows Presentation Foundation、Windows Communication Foundation 等。

So there are differences and you must not use those interchangeably.

因此存在差异,您不能互换使用它们。

回答by Ashish Shukla

BCLstands for Base class library also known as Class library (CL). BCL is a subset of Framework class library (FCL). Class library is the collection of reusable types that are closely integrated with CLR. Base Class library provides classes and types that are helpful in performing day to day operation e.g. dealing with string and primitive types, database connection, IO operations.

BCL代表基类库,也称为类库 (CL)。BCL 是框架类库 (FCL) 的子集。类库是与 CLR 紧密集成的可重用类型的集合。基类库提供有助于执行日常操作的类和类型,例如处理字符串和原始类型、数据库连接、IO 操作。

while Framework class library contains thousands of classes used to build different types of applications and provides all the basic functionalities and services that application needs. FCL includes classes and services to support different variety of application e.g.

而框架类库包含数千个用于构建不同类型应用程序的类,并提供应用程序所需的所有基本功能和服务。FCL 包括类和服务以支持不同种类的应用程序,例如

  • Desktop application,

  • Web application (ASP.Net, MVC, WCF),

  • Mobile application,

  • Xbox application,

  • windows services etc.

  • 桌面应用程序,

  • Web 应用程序(ASP.Net、MVC、WCF),

  • 移动应用程序,

  • Xbox 应用程序,

  • 窗口服务等

More details at What is BCL/ CL in .Net?

更多详细信息,在什么是BCL / CL在.net中?

enter image description here

在此处输入图片说明

回答by user1899020

The following is cited from the book "The C# Player's Guide".

以下内容摘自《The C# Player's Guide》一书。

The BCL contains all of the built-in types, arrays, exceptions, math libraries, basic File I/O, security, collections, reflection, networking, string manipulation, threading, and more. While not a perfect guide, a general rule is that any namespace that start with System is a part of the BCL.

BCL 包含所有内置类型、数组、异常、数学库、基本文件 I/O、安全性、集合、反射、网络、字符串操作、线程等。虽然不是一个完美的指南,但一般规则是任何以 System 开头的命名空间都是 BCL 的一部分。

Beyond the BCL, there are many more classes that Microsoft ships with the .NET Framework. In general, these additional things cover broad functional areas, such as database access or graphical user interfaces (Windows Forms or WPF). This entire collection, including the BCL, is called the Framework Class Library, or FCL. In casual discussion, sometimes people use FCL and BCL interchangeably, which isn't strictly correct, but it is perhaps good enough for most things.

除了 BCL,Microsoft 还随 .NET Framework 提供了更多类。通常,这些附加内容涵盖了广泛的功能领域,例如数据库访问或图形用户界面(Windows 窗体或 WPF)。包括 BCL 在内的整个集合称为框架类库或 FCL。在随意的讨论中,有时人们会交替使用 FCL 和 BCL,这并不严格正确,但对于大多数事情来说可能已经足够了。