.NET 4.0 和 .NET 4.5 在 .NET 中的高级差异
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10492647/
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
Differences between .NET 4.0 and .NET 4.5 in High level in .NET
提问by venkat
Eager to know Differences between .NET 4.0 and .NET 4.5 in High level in .NET and also differences in ASP.NET, C# also in these frameworks
渴望了解 .NET 4.0 和 .NET 4.5 在 .NET 中的高级差异以及 ASP.NET 中的差异,C# 也在这些框架中
采纳答案by Niranjan Singh
What is new in .NET Framework 4.5& What's new and expected in .NET Framework 4.5:
什么是.NET Framework中新的4.5& 什么新的和预期的.NET Framework 4.5:
- Support for Windows Runtime
- Support for Metro Style Applications
- Support for Async Programming
- Garbage Collector Improvements
- Faster ASP.NET Startup
- Better Data Access Support
- WebSockets Support
- Workflow Support - BCL Support
- 支持 Windows 运行时
- 支持 Metro 风格应用程序
- 支持异步编程
- 垃圾收集器改进
- 更快的 ASP.NET 启动
- 更好的数据访问支持
- 网络套接字支持
- 工作流支持 - BCL 支持
differences in ASP.NET in these frameworks
这些框架中 ASP.NET 的差异
Compare What's New in ASP.NET 4 and Visual Web Developerand What's New in ASP.NET 4.5 and Visual Studio 11 Beta:
比较什么在ASP.NET 4和Visual Web Developer中的新增和新消息在ASP.NET 4.5和Visual Studio 11 Beta版:
Asp.net 4.0
ASP.NET 4.0
Web.configFile Refactoring- Extensible Output Caching
- Auto-Start Web Applications
- Permanently Redirecting a Page
- Shrinking Session State
- Expanding the Range of Allowable URLs
- Extensible Request Validation
- Object Caching and Object Caching Extensibility
- Extensible HTML, URL, and HTTP Header Encoding
- Performance Monitoring for Individual Applications in a Single Worker Process
- Multi-Targeting
- etc
Web.config文件重构- 可扩展的输出缓存
- 自动启动 Web 应用程序
- 永久重定向页面
- 缩小会话状态
- 扩大允许的 URL 范围
- 可扩展请求验证
- 对象缓存和对象缓存扩展性
- 可扩展的 HTML、URL 和 HTTP 标头编码
- 单个工作进程中单个应用程序的性能监控
- 多目标
- 等等
And for Asp.net 4.5 there is also a long list of improvements:
对于 Asp.net 4.5,还有一长串改进:
- Asynchronously Reading and Writing HTTP Requests and Responses
- Improvements to
HttpRequesthandling - Asynchronously flushing a response
- Support for await and Task-Based Asynchronous Modules and Handlers
- 异步读取和写入 HTTP 请求和响应
HttpRequest处理的 改进- 异步刷新响应
- 支持 await 和基于任务的异步模块和处理程序
differences in C# also in these frameworks
C# 中的差异也在这些框架中
Go Through C# 4.0 - New C# Features in the .NET Frameworkand What's New for Visual C# in Visual Studio 11 Beta.
了解C# 4.0 - .NET Framework 中的新 C# 功能以及 Visual Studio 11 Beta 中 Visual C# 的新功能。
Edit:
The languages documentation for C# and VB breaking changes:
编辑:
C# 和 VB 重大更改的语言文档:
VB: Visual Basic Breaking Changes in Visual Studio 2012
VB:Visual Studio 2012 中的 Visual Basic 重大变化
C#: Visual C# Breaking Changes in Visual Studio 2012
C#:Visual C# 在 Visual Studio 2012 中的重大变化
Hope this help you get what are you looking for..
希望这能帮助你得到你想要的东西..
回答by VS1
.NET Framework 4
.NET 框架 4
Microsoft announced the intention to ship .NET Framework 4 on 29 September 2008. The Public Beta was released on 20 May 2009.
Microsoft 于 2008 年 9 月 29 日宣布打算发布 .NET Framework 4。公共测试版于 2009 年 5 月 20 日发布。
- Parallel Extensions to improve support for parallel computing, which target multi-core or distributed systems. To this end, technologies like PLINQ (Parallel LINQ), a parallel implementation of the LINQ engine, and Task Parallel Library, which exposes parallel constructs via method calls., are included.
- New Visual Basic .NET and C# language features, such as implicit line continuations, dynamic dispatch, named parameters, and optional parameters.
- Support for Code Contracts.
- Inclusion of new types to work with arbitrary-precision arithmetic (System.Numerics.BigInteger) and complex numbers (System.Numerics.Complex).
- Introduce Common Language Runtime (CLR) 4.0.
- 并行扩展以改进对并行计算的支持,其目标是多核或分布式系统。为此,包括 PLINQ(并行 LINQ)、LINQ 引擎的并行实现和通过方法调用公开并行构造的任务并行库等技术。
- 新的 Visual Basic .NET 和 C# 语言功能,例如隐式续行、动态分派、命名参数和可选参数。
- 支持代码契约。
- 包含用于处理任意精度算术 (System.Numerics.BigInteger) 和复数 (System.Numerics.Complex) 的新类型。
- 引入公共语言运行时 (CLR) 4.0。
After the release of the .NET Framework 4, Microsoft released a set of enhancements, named Windows Server AppFabric, for application server capabilities in the form of AppFabric Hosting and in-memory distributed caching support.
在 .NET Framework 4 发布之后,Microsoft 发布了一组增强功能,名为 Windows Server AppFabric,以 AppFabric Hosting 和内存中分布式缓存支持的形式为应用服务器功能提供支持。
.NET Framework 4.5
.NET 框架 4.5
.NET Framework 4.5 was released on 15 August 2012., a set of new or improved features were added into this version. The .NET Framework 4.5 is only supported on Windows Vista or later. The .NET Framework 4.5 uses Common Language Runtime 4.0, with some additional runtime features.
.NET Framework 4.5 于 2012 年 8 月 15 日发布。此版本中添加了一组新的或改进的功能。.NET Framework 4.5 仅在 Windows Vista 或更高版本上受支持。.NET Framework 4.5 使用公共语言运行时 4.0,以及一些额外的运行时功能。
1. .NET for Metro style apps
1. .NET 用于 Metro 风格的应用程序
Metro-style apps are designed for specific form factors and leverage the power of the Windows operating system. A subset of the .NET Framework is available for building Metro style apps for Windows 8 using C# or Visual Basic. This subset is called .NET APIs for apps. The version of .NET Framework, runtime and libraries, used for Metro style apps is a part of the new Windows Runtime, which is the new platform and application model for Metro style apps. It is an ecosystem that houses many platforms and languages, including .NET Framework, C++ and HTML5/JavaScript.
Metro 风格的应用程序专为特定的外形因素而设计,并利用了 Windows 操作系统的强大功能。.NET Framework 的一个子集可用于使用 C# 或 Visual Basic 构建适用于 Windows 8 的 Metro 风格应用程序。此子集称为应用程序的 .NET API。用于 Metro 风格应用程序的 .NET Framework、运行时和库版本是新 Windows 运行时的一部分,它是 Metro 风格应用程序的新平台和应用程序模型。它是一个包含许多平台和语言的生态系统,包括 .NET Framework、C++ 和 HTML5/JavaScript。
2. Core Features
2. 核心功能
- Ability to limit how long the regular expression engine will attempt to resolve a regular expression before it times out.
- Ability to define the culture for an application domain.
- Console support for Unicode (UTF-16) encoding.
- Support for versioning of cultural string ordering and comparison data.
- Better performance when retrieving resources.
- Zip compression improvements to reduce the size of a compressed file.
- Ability to customize a reflection context to override default reflection behavior through the CustomReflectionContext class.
- 能够限制正则表达式引擎在超时之前尝试解析正则表达式的时间。
- 能够定义应用程序域的文化。
- 控制台支持 Unicode (UTF-16) 编码。
- 支持文化字符串排序和比较数据的版本控制。
- 检索资源时的性能更好。
- Zip 压缩改进以减少压缩文件的大小。
- 能够自定义反射上下文以通过 CustomReflectionContext 类覆盖默认反射行为。
3. Managed Extensibility Framework (MEF)
3. 托管可扩展性框架 (MEF)
- Support for generic types.
- Convention-based programming model that enables you to create parts based on naming conventions rather than attributes.
- Multiple scopes.
- 支持泛型类型。
- 基于约定的编程模型,使您能够根据命名约定而不是属性创建零件。
- 多个范围。
4. Asynchronous operations
4. 异步操作
In the .NET Framework 4.5, new asynchronous features were added to the C# and Visual Basic languages. These features add a task-based model for performing asynchronous operations.
在 .NET Framework 4.5 中,新的异步功能被添加到 C# 和 Visual Basic 语言中。这些功能添加了一个基于任务的模型来执行异步操作。
5. ASP.NET
5. ASP.NET
- Support for new HTML5 form types.
- Support for model binders in Web Forms. These let you bind data controls directly to data-access methods, and automatically convert user input to and from .NET Framework data types.
- Support for unobtrusive JavaScript in client-side validation scripts.
- Improved handling of client script through bundling and minification for improved page performance.
- Integrated encoding routines from the AntiXSS library (previously an external library) to protect from cross-site scripting attacks.
- Support for WebSocket protocol.
- Support for reading and writing HTTP requests and responses asynchronously.
- Support for asynchronous modules and handlers.
- Support for content distribution network (CDN) fallback in the ScriptManager control.
- 支持新的 HTML5 表单类型。
- 支持 Web 窗体中的模型绑定器。这些使您可以将数据控件直接绑定到数据访问方法,并自动将用户输入与 .NET Framework 数据类型相互转换。
- 在客户端验证脚本中支持不显眼的 JavaScript。
- 通过捆绑和缩小改进对客户端脚本的处理,以提高页面性能。
- 来自 AntiXSS 库(以前是外部库)的集成编码例程,以防止跨站点脚本攻击。
- 支持 WebSocket 协议。
- 支持异步读写 HTTP 请求和响应。
- 支持异步模块和处理程序。
- 支持 ScriptManager 控件中的内容分发网络 (CDN) 回退。
6. Networking
6. 网络
- Provides a new programming interface for HTTP applications: System.Net.Http namespace and System.Net.Http.Headers namespaces are added.
- Other improvements: Improved internationalization and IPv6 support. RFC-compliant URI support. Support for Internationalized Domain Name (IDN) parsing. Support for Email Address Internationalization (EAI).
- 为 HTTP 应用程序提供了一个新的编程接口:添加了 System.Net.Http 命名空间和 System.Net.Http.Headers 命名空间。
- 其他改进: 改进了国际化和 IPv6 支持。符合 RFC 的 URI 支持。支持国际化域名 (IDN) 解析。支持电子邮件地址国际化 (EAI)。
7. Windows Presentation Foundation (WPF)
7. Windows 演示基础 (WPF)
- The new Ribbon control, which enables you to implement a ribbon user interface that hosts a Quick Access Toolbar, Application Menu, and tabs.
- The new INotifyDataErrorInfo interface, which supports synchronous and asynchronous data validation.
- New features for the VirtualizingPanel and Dispatcher classes.
- Improved performance when displaying large sets of grouped data, and by accessing collections on non-UI threads.
- Data binding to static properties, data binding to custom types that implement the ICustomTypeProvider interface and retrieval of data binding information from a binding expression.
- Repositioning of data as the values change (live shaping).
- Better integration between WPF and Win32 user interface components.
- Ability to check whether the data context for an item container is disconnected.
- Ability to set the amount of time that should elapse between property changes and data source updates.
- Improved support for implementing weak event patterns. Also, events can now accept markup extensions.
- 新的 Ribbon 控件,它使您能够实现承载快速访问工具栏、应用程序菜单和选项卡的功能区用户界面。
- 新的 INotifyDataErrorInfo 接口,支持同步和异步数据验证。
- VirtualizingPanel 和 Dispatcher 类的新功能。
- 在显示大量分组数据时以及通过访问非 UI 线程上的集合时提高了性能。
- 数据绑定到静态属性、数据绑定到实现 ICustomTypeProvider 接口的自定义类型以及从绑定表达式中检索数据绑定信息。
- 随着值的变化重新定位数据(实时整形)。
- WPF 和 Win32 用户界面组件之间更好的集成。
- 能够检查项目容器的数据上下文是否断开连接。
- 能够设置属性更改和数据源更新之间应经过的时间量。
- 改进了对实现弱事件模式的支持。此外,事件现在可以接受标记扩展。
8. Windows Communication Foundation (WCF)
8. Windows 通信基础 (WCF)
In the .NET Framework 4.5, the following features have been added to make it simpler to write and maintain Windows Communication Foundation (WCF) applications:
在 .NET Framework 4.5 中,添加了以下功能以简化 Windows Communication Foundation (WCF) 应用程序的编写和维护:
- Simplification of generated configuration files.
- Support for contract-first development.
- Ability to configure ASP.NET compatibility mode more easily.
- Changes in default transport property values to reduce the likelihood that you will have to set them.
- Updates to the XmlDictionaryReaderQuotas class to reduce the likelihood that you will have to manually configure quotas for XML dictionary readers.
- Validation of WCF configuration files by Visual Studio as part of the build process, so you can detect configuration errors before you run your application.
- New asynchronous streaming support.
- New HTTPS protocol mapping to make it easier to expose an endpoint over HTTPS with Internet Information Services (IIS).
- Ability to generate metadata in a single WSDL document by appending ?singleWSDL to the service URL.
- Websockets support to enable true bidirectional communication over ports 80 and 443 with performance characteristics similar to the TCP transport.
- Support for configuring services in code.
- XML Editor tooltips.
- ChannelFactory caching support.
- Binary encoder compression support.
- Support for a UDP transport that enables developers to write services that use "fire and forget" messaging. A client sends a message to a service and expects no response from the service.
- Ability to support multiple authentication modes on a single WCF endpoint when using the HTTP transport and transport security.
- Support for WCF services that use internationalized domain names (IDNs).
- 生成的配置文件的简化。
- 支持契约优先开发。
- 能够更轻松地配置 ASP.NET 兼容模式。
- 更改默认传输属性值以减少您必须设置它们的可能性。
- 更新 XmlDictionaryReaderQuotas 类以减少您必须为 XML 字典阅读器手动配置配额的可能性。
- 在构建过程中由 Visual Studio 验证 WCF 配置文件,因此您可以在运行应用程序之前检测配置错误。
- 新的异步流支持。
- 新的 HTTPS 协议映射,可以更轻松地使用 Internet 信息服务 (IIS) 通过 HTTPS 公开终结点。
- 通过将 ?singleWSDL 附加到服务 URL,能够在单个 WSDL 文档中生成元数据。
- Websockets 支持通过端口 80 和 443 实现真正的双向通信,其性能特征类似于 TCP 传输。
- 支持在代码中配置服务。
- XML 编辑器工具提示。
- ChannelFactory 缓存支持。
- 二进制编码器压缩支持。
- 支持 UDP 传输,使开发人员能够编写使用“即发即忘”消息传递的服务。客户端向服务发送消息,但不希望该服务做出响应。
- 使用 HTTP 传输和传输安全时,能够在单个 WCF 终结点上支持多种身份验证模式。
- 支持使用国际化域名 (IDN) 的 WCF 服务。
9. Tools
9. 工具
- Resource File Generator (Resgen.exe) enables you to create a .resw file for use in Windows Store apps from a .resources file embedded in a .NET Framework assembly.
- Managed Profile Guided Optimization (Mpgo.exe) enables you to improve application startup time, memory utilization (working set size), and throughput by optimizing native image assemblies. The command-line tool generates profile data for native image application assemblies.
- 资源文件生成器 (Resgen.exe) 使您能够从嵌入在 .NET Framework 程序集中的 .resources 文件创建用于 Windows 应用商店应用程序的 .resw 文件。
- 托管配置文件引导优化 (Mpgo.exe) 使您能够通过优化本机映像程序集来改进应用程序启动时间、内存利用率(工作集大小)和吞吐量。命令行工具为本机图像应用程序程序集生成配置文件数据。
For more information and access to reference links, please visit:
如需更多信息和访问参考链接,请访问:
- .NET Framework version history
- What's New in the .NET Framework 4.5
- .NET Framework Versions and Dependencies
===========.Net 4.5 Poster=========
============ .Net 4.5 海报==========
回答by Ryan Spears
You can find the latest features of the .NET Framework 4.5 beta here
您可以在此处找到 .NET Framework 4.5 测试版的最新功能
It breaks down the changes to the framework in the following categories:
它将对框架的更改分为以下几类:
- .NET for Metro style Apps
- Portable Class Libraries
- Core New Features and Improvements
- Parallel Computing
- Web
- Networking
- Windows Presentation Foundation (WPF)
- Windows Communication Foundation (WCF)
- Windows Workflow Foundation (WF)
- .NET 用于 Metro 风格的应用程序
- 便携式类库
- 核心新功能和改进
- 并行计算
- 网络
- 联网
- Windows 演示基础 (WPF)
- Windows 通信基础 (WCF)
- Windows 工作流基础 (WF)
You sound like you are more interested in the Web section as this shows the changes to ASP.NET 4.5. The rest of the changes can be found under the other headings.
您听起来对 Web 部分更感兴趣,因为它显示了对 ASP.NET 4.5 的更改。其余的更改可以在其他标题下找到。
You can also see some of the features that were new when the .NET Framework 4.0 was shipped here.
您还可以在此处查看.NET Framework 4.0 发布时的一些新功能。
回答by Raghavendra Devraj
This answer may be late reply but it will be useful for seeing this topic in future.
这个答案可能是迟到的回复,但它对将来看到这个主题很有用。
The features of .NET framework 4.5 can be seen in the following link.
.NET framework 4.5 的特性可以在以下链接中看到。
To summarize:
总结一下:
Installation
.NET Framework 4.5 does not support Windows XP or Windows Server 2003, and therefore, if you have to create applications that target these operating systems, you will need to stay with .NET Framework 4.0. In contrast, Windows 8 and Windows Server 2012 in all of their editions include .NET Framework 4.5.
- Support for Arrays Larger than 2 GB on 64-bit Platforms
- Enhanced Background Server Garbage Collection
- Support for Timeouts in Regular Expression Evaluations
- Support for Unicode 6.0.0 in Culture-Sensitive Sorting and Casing Rules on Windows 8
- Simple Default Culture Definition for an Application Domain
- Internationalized Domain Names in Windows 8 Apps
安装
.NET Framework 4.5 不支持 Windows XP 或 Windows Server 2003,因此,如果您必须创建针对这些操作系统的应用程序,则需要继续使用 .NET Framework 4.0。相比之下,Windows 8 和 Windows Server 2012 的所有版本都包含 .NET Framework 4.5。
- 在 64 位平台上支持大于 2 GB 的阵列
- 增强的后台服务器垃圾收集
- 支持正则表达式计算中的超时
- 在 Windows 8 上的文化敏感排序和大小写规则中支持 Unicode 6.0.0
- 应用程序域的简单默认文化定义
- Windows 8 应用程序中的国际化域名
回答by dodgy_coder
Here is a great resource from Microsoft which includes a high level features overview for each .NET release since 1.0 up to the present day. It also include information about the associated Visual Studio release and Windows version compatibility.
这是来自 Microsoft 的一个很好的资源,其中包括自 1.0 至今的每个 .NET 版本的高级功能概述。它还包括有关相关 Visual Studio 版本和 Windows 版本兼容性的信息。


