這是歷史版本頁面 — 看 .NET Framework (4) 最新版本
裝軟體跳出缺.NET Framework 4,它到底在幹嘛
你下載了一個想用的軟體,雙擊安裝檔,結果畫面跳出一串英文,說你的電腦缺少 .NET Framework 4,問你要不要下載安裝。你當下只想快點把軟體裝好,根本不想研究這是什麼東西,但偏偏不裝它,你要的軟體就是開不起來。這種「被系統攔住、卡在安裝第一步」的感覺,很多人都在裝遊戲、繪圖軟體或公司內部工具時遇過。
有些人會直接略過提示,結果軟體打不開;有些人上網亂抓安裝檔,裝了一堆來路不明的東西。其實這類工具扮演的角色很單純:它是一個執行環境,讓用特定程式語言寫出來的軟體能在 Windows 上跑。你不需要懂技術細節,只要知道「當軟體要求它,你就裝它」就夠了。
01裝遊戲或程式一直跳出要裝 .NET Framework 4,不裝會怎樣
不裝的話,那個軟體通常無法啟動,或啟動後立刻閃退。它提供執行環境和共用程式庫,很多 Windows 軟體在開發時就依賴它,少了它,軟體找不到需要的元件就會直接放棄執行。如果你遇到的是安裝檔主動跳出提示,照著安裝通常就能解決;如果裝完還是不能跑,問題可能出在別的地方。
02這套軟體裝了之後到底能幹嘛,我平常只上網看影片需要嗎
它本身沒有操作介面,不是一個你會打開來用的軟體。它是在背景提供執行環境,讓其他軟體能正常運作。一般使用者不會直接感受到它的存在,只有當你安裝的軟體或遊戲需要它時,系統才會跳出安裝提示。如果你沒遇過任何軟體要求它,就不需要主動安裝。
03它跟 .NET Core 差在哪,我該裝哪個
資料裡提到,.NET Framework 主要針對 Windows 平台,.NET Core 和 .NET 5+ 是後繼者,支援跨平台、架構更模組化。如果你只是要跑現有的 Windows 軟體,裝 .NET Framework 就夠了;如果你是開發者、要做跨平台應用,才需要考慮 .NET Core 或 .NET 5+。兩者用途不同,不是取代關係。
04裝了之後電腦會變慢嗎,會不會拖累效能
資料提到這版有效能最佳化和垃圾回收改進,理論上能讓依賴它的軟體跑得更順。但對一般使用者來說,它平常在背景待命,不會持續占用資源,實際影響很難感覺出來。如果你的電腦硬體規格較舊,裝了之後沒有明顯變慢,就不用擔心;如果真的覺得卡,問題通常出在別的地方。
05它支援哪些 Windows 版本,Win 7 或更舊的能裝嗎
資料顯示它支援 Windows 8、Windows 10、Windows 11。更舊的 Windows 版本沒有被列在支援清單裡,如果你還在用 Windows 7 或更早的系統,需要去微軟官網確認有沒有對應的版本可裝。另外,系統版本太舊的話,就算裝了,也可能因為缺少其他元件而無法正常運作。
06我是寫程式的,用這套開發有什麼要注意的
資料說它支援 C#、VB.NET、F# 等語言,提供豐富的類別庫,適合開發 Windows 桌面、Web 和行動應用。但要注意,微軟的重心已經轉到 .NET Core 和 .NET 5+,新專案建議先評估要不要直接用新平台。如果你要維護舊系統或開發 Windows 限定功能,用它還是可行的選擇。
07一般使用者遇到跳出提示,直接按安裝就好嗎
資料說安裝過程很直接,通常會隨 Windows Update 一起提供,也可以從微軟官網下載安裝程式。遇到提示時,照著指示安裝就好,裝完通常就能繼續安裝原本的軟體。要注意的是,下載來源要認明微軟官方管道,不要從不明網站抓安裝檔,以免裝到來路不明的東西。
08新專案還用這套開發適合嗎,會不會走回頭路
資料的結論寫得很清楚:微軟重心已經轉到 .NET Core 和 .NET 5+,.NET Framework 對新專案來說已經不是優先選擇。如果你要開發全新的應用,建議直接學 .NET Core 或 .NET 5+,除非你的專案有特殊需求,例如必須使用 Windows 限定功能,或要維護既有系統,才需要繼續用它。
09我要做跨平台 App,這套能應付嗎
資料明確提到它跨平台支援有限,主要針對 Windows 平台。如果你要開發能在 Windows、macOS、Linux 或手機上跑的應用,它不適合。這種情況應該考慮 .NET Core 或 .NET 5+,或改用 Java、Python、Node.js 等其他替代方案。先確認你的目標平台,再決定要用哪套工具。
10電腦裡已經有 .NET Framework 3.5,還要裝 4 嗎
資料沒有直接說明不同版本能否共存,但版本紀錄顯示它收錄了多個版本,代表不同版本可能同時存在於系統中。一般來說,不同版本的 .NET Framework 可以並存,不會互相覆蓋。建議先確認你要跑的軟體需要哪個版本,再決定要不要裝;如果軟體明確要求 4,就裝 4。
11這套軟體多久沒更新了,放著不管會有安全風險嗎
資料顯示它近兩年沒有更新紀錄,微軟的開發重心已經轉到 .NET Core 和 .NET 5+。雖然它本身算穩定,但長期沒有新版本,代表如果有安全漏洞,可能不會獲得修補。如果你只是為了跑舊軟體而裝它,風險相對低;如果在意安全,可以留意微軟官方的公告和建議。
下載與官方連結
NDP462-KB3151800-x86-x64-AllOS-ENU.exe · 59.14 MB · 連結指向軟體原廠
版本紀錄
- 2022-08-30 .NET Framework 4.8.1
- 2019-04-19 .NET Framework Version 4.8 69.35 MB
- 2018-05-01 .NET Framework Version 4.7.2 68.29 MB
再看 5 筆
- 2017-10-18 .NET Framework Version 4.7.1
- 2017-04-07 .NET Framework Version 4.7 58.73 MB
- 2016-08-02 .NET Framework Version 4.6.2 59.14 MB
- 2015-12-01 .NET Framework Version 4.6.1 64.55 MB
- 2015-07-22 .NET Framework Version 4.6 62.41 MB
這一版改了什麼
What's new in this version:
ASP.NET:
Improved support for localized error messages in data annotation validators:
- Data annotation validators enable you to perform validation by adding one or more attributes to a class property. The attribute's ValidationAttribute.ErrorMessage element defines the text of the error message if validation fails. Starting with the .NET Framework 4.6.2, ASP.NET makes it easy to localize error messages.
Async support with session-state store providers:
- ASP.NET now allows task-returning methods to be used with session-state store providers, thereby allowing ASP.NET apps to get the scalability benefits of async. To supports asynchronous operations with session state store providers, ASP.NET includes a new interface, System.Web.SessionState.ISessionStateModule, which inherits from IHttpModule and allows developers to implement their own session-state module and async session store providers. In addition, the SessionStateUtility class includes two new methods, IsSessionStateReadOnly and IsSessionStateRequired, that can be used to support asynchronous operations.
Async support for output-cache providers:
- Starting with the .NET Framework 4.6.2, task-returning methods can be used with output-cache providers to provide the scalability benefits of async. Providers that implement these methods reduce thread-blocking on a web server and improve the scalability of an ASP.NET service. The following APIs have been added to support asynchronous output-cache providers:
- The System.Web.Caching.OutputCacheProviderAsync class, which inherits from System.Web.Caching.OutputCacheProvider and allows developers to implement an asynchronous output-cache provider.
- The OutputCacheUtility class, which provides helper methods for configuring the output cache.
- 18 new methods in the System.Web.HttpCachePolicyclass. These include GetCacheability, GetCacheExtensions, GetETag, GetETagFromFileDependencies, GetMaxAge, GetMaxAge, GetNoStore, GetNoTransforms, GetOmitVaryStar, GetProxyMaxAge, GetRevalidation, GetUtcLastModified, GetVaryByCustom, HasSlidingExpiration, and IsValidUntilExpires.
- 2 new methods in the System.Web.HttpCacheVaryByContentEncodings class: GetContentEncodings and SetContentEncodings.
- 2 new methods in the System.Web.HttpCacheVaryByHeaders class: GetHeaders and SetHeaders.
- 2 new methods in the System.Web.HttpCacheVaryByParams class: GetParams and SetParams.
- In the System.Web.Caching.AggregateCacheDependency class, the GetFileDependencies method.
- In the CacheDependency, the GetFileDependencies method.
CHARACTER CATEGORIES:
- Characters in the .NET Framework 4.6.2 are classified based on the Unicode Standard, Version 8.0.0. In .NET Framework 4.6 and .NET Framework 4.6.1, characters were classified based on Unicode 6.3 character categories.
- Support for Unicode 8.0 is limited to the classification of characters by the CharUnicodeInfo class and to types and methods that rely on it. These include the StringInfo class, the overloaded Char.GetUnicodeCategory method, and the character classes recognized by the .NET Framework regular expression engine. Character and string comparison and sorting is unaffected by this change and continues to rely on the underlying operating system or, on Windows 7 systems, on character data provided by the .NET Framework.
CRYPTOGRAPHY:
Support for X509 certificates containing FIPS 186-3 DSA:
- The .NET Framework 4.6.2 adds support for DSA (Digital Signature Algorithm) X509 certificates whose keys exceed the FIPS 186-2 1024-bit limit.
- In addition to supporting the larger key sizes of FIPS 186-3, the .NET Framework 4.6.2 allows computing signatures with the SHA-2 family of hash algorithms (SHA256, SHA384, and SHA512). FIPS 186-3 support is provided by the new System.Security.Cryptography.DSACng class.
- In keeping with recent changes to the RSA class in the .NET Framework 4.6 and the ECDsa class in the .NET Framework 4.6.1, the DSA abstract base class in .NET Framework 4.6.2 has additional methods to allow callers to use this functionality without casting.
Increased clarity for inputs to ECDiffieHellman key derivation routines:
- The .NET Framework 3.5 added support for Ellipic Curve Diffie-Hellman Key Agreement with three different Key Derivation Function (KDF) routines. The inputs to the routines, and the routines themselves, were configured via properties on the ECDiffieHellmanCng object. But since not every routine read every input property, there was ample room for confusion on the past of the developer.
- To address this in the .NET Framework 4.6.2, the following three methods have been added to the ECDiffieHellman base class to more clearly represent these KDF routines and their inputs: DeriveKeyFromHash(ECDiffieHellmanPublicKey, HashAlgorithmName, Byte[], Byte[]), DeriveKeyFromHmac(ECDiffieHellmanPublicKey, HashAlgorithmName, Byte[], Byte[], Byte[]), DeriveKeyTls(ECDiffieHellmanPublicKey, Byte[], Byte[])
Support for persisted-key symmetric encryption:
- The Windows cryptography library (CNG) added support for storing persisted symmetric keys and using hardware-stored symmetric keys, and the .NET Framework 4.6.2 mades it possible for developers to make use of this feature. Since the notion of key names and key providers is implementation-specific, using this feature requires utilizing the constructor of the concrete implementation types instead of the preferred factory approach (such as calling Aes.Create). Persisted-key symmetric encryption support exists for the AES (AesCng) and 3DES (TripleDESCng) algorithms.
SignedXml support for SHA-2 hashing:
- The .NET Framework 4.6.2 adds support to the SignedXml class for RSA-SHA256, RSA-SHA384, and RSA-SHA512 PKCS#1 signature methods, and SHA256, SHA384, and SHA512 reference digest algorithms. The URI constants are all exposed on SignedXml. Any programs that have registered a custom SignatureDescription handler into CryptoConfig to add support for these algorithms will continue to function as they did in the past, but since there are now platform defaults, the CryptoConfig registration is no longer necessary.
SQLCLIENT:
Connection pooling and timeouts with Azure SQL databases:
- When connection pooling is enabled and a timeout or other login error occurs, an exception is cached, and the cached exception is thrown on any subsequent connection attempt for the next 5 seconds to 1 minute. For more details, see SQL Server Connection Pooling (ADO.NET).
- This behavior is not desirable when connecting to Azure SQL Databases, since connection attempts can fail with transient errors that are typically recovered quickly. To better optimize the connection retry experience, the connection pool blocking period behavior is removed when connections to Azure SQL Databases fail.
- The addition of the new PoolBlockingPeriod keyword lets you to select the blocking period best suited for your app.
Enhancements for Always Encrypted:
- To improve performance of parameterized queries against encrypted database columns, encryption metadata for query parameters is now cached. With the SqlConnection.ColumnEncryptionQueryMetadataCacheEnabled property set to true (which is the default value), if the same query is called multiple times, the client retrieves parameter metadata from the server only once
- Column encryption key entries in the key cache are now evicted after a configurable time interval, set using the SqlConnection.ColumnEncryptionKeyCacheTtl property
WINDOWS COMMUNICATION FOUNDATION:
WCF transport security support for certificates stored using CNG:
- WCF transport security supports certificates stored using the Windows cryptography library (CNG). In the .NET Framework 4.6.2, this support is limited to using certificates with a public key that has an exponent no more than 32 bits in length. When an application targets the .NET Framework 4.6.2, this feature is on by default.
- For applications that target the .NET Framework 4.6.1 and earlier but are running on the .NET Framework 4.6.2, this feature can be enabled by adding the following line to the section of the app.config or web.config file.
Better support for multiple daylight saving time adjustment rules by the DataContractJsonSerializer class:
- Customers can use an application configuration setting to determine whether the DataContractJsonSerializer class supports multiple adjustment rules for a single time zone. This is an opt-in feature. To enable it, add the following setting to your app.config file.
- When this feature is enabled, a DataContractJsonSerializer object uses the TimeZoneInfo type instead of the TimeZone type to deserialize date and time data. TimeZoneInfo supports multiple adjustment rules, which makes it possible to work with historic time zone data; TimeZone does not.
Support for preserving a UTC time when serializing and deserializing with the XMLSerializer class:
- Ordinarily, when the XmlSerializer class is used to serialize a UTC DateTime value, it creates a serialized time string that preserves the date and time but assumes the time is local. For example, if you instantiate a UTC date and time by calling the following code.
NetNamedPipeBinding best match:
- WCF has a new app setting that can be set on client applications to ensure they always connect to the service listening on the URI that best matches the one that they request. With this app setting set to false (the default), it is possible for clients using NetNamedPipeBinding to attempt to connect to a service listening on a URI that is a substring of the requested URI.
- For example, a client tries to connect to a service listening at net.pipe://localhost/Service1, but a different service on that machine running with administrator privilege is listening at net.pipe://localhost. With this app setting set to false, the client would attempt to connect to the wrong service. After setting the app setting to true, the client will always connect to the best matching service.
SSL 3.0 is not a default protocol:
- When using NetTcp with transport security and a credential type of certificate, SSL 3.0 is no longer a default protocol used for negotiating a secure connection. In most cases, there should be no impact to existing apps, because TLS 1.0 is included in the protocol list for NetTcp. All existing clients should be able to negotiate a connection using at least TLS 1.0. If Ssl3 is required, use one of the following configuration mechanisms to add it to the list of negotiated protocols.
- The SslStreamSecurityBindingElement.SslProtocols property
- The TcpTransportSecurity.SslProtocols property
- The section of the section
- The section of the section
WINDOWS PRESENTATION FOUNDATION:
Group sorting:
- An application that uses a CollectionView object to group data can now explicitly declare how to sort the groups. Explicit sorting addresses the problem of non-intuitive ordering that occurs when an app dynamically adds or removes groups, or when it changes the value of item properties involved in grouping. It can also improve the performance of the group creation process by moving comparisons of the grouping properties from the sort of the full collection to the sort of the groups.
- To support group sorting, the new GroupDescription.SortDescriptions and GroupDescription.CustomSort properties describe how to sort the collection of groups produced by the GroupDescription object. This is analogous to the way the identically named ListCollectionView properties describe how to sort the data items.
- Two new static properties of the PropertyGroupDescription class, CompareNameAscending and CompareNameDescending, can be used for the most common cases.
- For example, the following XAML groups data by age, sort the age groups in ascending order, and group the items within each age group by last name.
Soft keyboard support:
- Soft Keyboard support enables focus tracking in a WPF applications by automatically invoking and dismissing the new Soft Keyboard in Windows 10 when the touch input is received by a control that can take textual input.
- In previous versions of the .NET Framework, WPF applications cannot opt into the focus tracking without disabling WPF pen/touch gesture support. As a result, WPF applications must choose between full WPF touch support or rely on Windows mouse promotion
Per-monitor DPI:
- To support the recent proliferation of high-DPI and hybrid-DPI environments for WPF apps, WPF in the .NET Framework 4.6.2 enables per-monitor awareness. See the samples and developer guide on GitHub for more information about how to enable your WPF app to become per-monitor DPI aware.
- In previous versions of the .NET Framework, WPF apps are system-DPI aware. In other words, the application's UI is scaled by the OS as appropriate, depending on the DPI of the monitor on which the app is rendered. ,
- For apps running under the .NET Framework 4.6.2, you can disable per-monitor DPI changes in WPF apps by adding a configuration statement to the section of your application configuration file.
WINDOWS WORKFLOW FOUNDATION:
- Support for C# expressions and IntelliSense in the Re-hosted WF Designer
- Starting with the .NET Framework 4.5, WF supports C# expressions in both the Visual Studio Designer and in code workflows. The Re-hosted Workflow Designer is a key feature of WF that allows for the Workflow Designer to be in an application outside Visual Studio (for example, in WPF). Windows Workflow Foundation provides the ability to support C# expressions and IntelliSense in the Re-hosted Workflow Designer.
- Availability of IntelliSense when a customer rebuilds a workflow project from Visual Studio:
- In versions of the .NET Framework prior to the .NET Framework 4.6.2, WF Designer IntelliSense is broken when a customer rebuilds a workflow project from Visual Studio. While the project build is successful, the workflow types are not found on the designer, and warnings from IntelliSense for the missing workflow types appear in the Error List window. The .NET Framework 4.6.2 addresses this issue and makes IntelliSense available.
Workflow V1 applications with Workflow Tracking on now run under FIPS-mode:
- Machines with FIPS Compliance Mode enabled can now successfully run a workflow Version 1-style application with Workflow tracking on. To enable this scenario, you must make the following change to your app.config file: 'add key="microsoft:WorkflowRuntime:FIPSRequired" value="true" /'
- Workflow Improvements when using Dynamic Update with Visual Studio Workflow Designer:
- The Workflow Designer, FlowChart Activity Designer, and other Workflow Activity Designers now successfully load and display workflows that have been saved after calling the DynamicUpdateServices.PrepareForUpdate method. In versions of the .NET Framework before the .NET Framework 4.6.2, loading a XAML file in Visual Studio for a workflow that has been saved after calling DynamicUpdateServices.PrepareForUpdate can result in the following issues:
- The Workflow Designer can't load the XAML file correctly (when the ViewStateData.Id is at the end of the line).
- Flowchart Activity Designer or other Workflow Activity Designers may display all objects in their default locations as opposed to attached property values.
CLICKONCE:
- ClickOnce has been updated to support TLS 1.1 and TLS 1.2 in addition to the 1.0 protocol, which it already supports. ClickOnce automatically detects which protocol is required; no extra steps within the ClickOnce application are required to enable TLS 1.1 and 1.2 support.
CONVERTING WINDOWS FORMS AND WPF APPS TO UWP APPS:
- Windows now offers capabilities to bring existing Windows desktop apps, including WPF and Windows Forms apps, to the Universal Windows Platform (UWP). This technology acts as a bridge by enabling you to gradually migrate your existing code base to UWP, thereby bringing your app to all Windows 10 devices.
- Converted desktop apps gain an app identity similar to the app identity of UWP apps, which makes UWP APIs accessible to enable features such as Live Tiles and notifications. The app continues to behave as before and runs as a full trust app. Once the app is converted, an app container process can be added to the existing full trust process to add an adaptive user interface. When all functionality is moved to the app container process, the full trust process can be removed and the new UWP app can be made available to all Windows 10 devices.
DEBUGGING IMPROVEMENTS:
- The unmanaged debugging API has been enhanced in the .NET Framework 4.6.2 to perform additional analysis when a NullReferenceException is thrown so that it is possible to determine which variable in a single line of source code is null. To support this scenario, the following APIs have been added to the unmanaged debugging API.
- The ICorDebugCode4, ICorDebugVariableHome, and ICorDebugVariableHomeEnum interfaces, which expose the native homes of managed variables. This enables debuggers to do some code flow analysis when a NullReferenceException occurs and to work backwards to determine the managed variable that corresponds to the native location that was null.
- The ICorDebugType2::GetTypeID method provides a mapping for ICorDebugType to COR_TYPEID, which allows the debugger to obtain a COR_TYPEID without an instance of the ICorDebugType. Existing APIs on COR_TYPEID can then be used to determine the class layout of the type.