.NET Framework 4.8、4.7、4.6 和 4.5 移轉手冊Migration Guide to the .NET Framework 4.8, 4.7, 4.6, and 4.5

如果您使用舊版的 .NET Framework 建立應用程式,通常可以輕鬆地將它升級到 .NET Framework 4.5 及其小數點版本 (4.5.1 和 4.5.2)、.NET Framework 4.6 及其小數點版本 (4.6.1 和 4.6.2)、.NET Framework 4.7 及其小數點版本 (4.7.1 和 4.7.2) 或 .NET Framework 4.8。If you created your app using an earlier version of the .NET Framework, you can generally upgrade it to .NET Framework 4.5 and its point releases (4.5.1 and 4.5.2), .NET Framework 4.6 and its point releases (4.6.1 and 4.6.2), .NET Framework 4.7 and its point releases (4.7.1 and 4.7.2), or .NET Framework 4.8 easily. 在 Visual Studio 中開啟專案。Open your project in Visual Studio. 如果您的專案是使用舊版 Visual Studio 所建立,則會自動開啟 [專案相容性] 對話方塊。If your project was created in an earlier version of Visual Studio, the Project Compatibility dialog box automatically opens. 如需升級 Visual Studio 專案的詳細資訊,請參閱移植、移轉及升級 Visual Studio 專案Visual Studio 2019 平台目標及相容性For more information about upgrading a project in Visual Studio, see Port, Migrate, and Upgrade Visual Studio Projects and Visual Studio 2019 Platform Targeting and Compatibility.

不過,.NET Framework 中的某些變更需要變更您的程式碼。However, some changes in the .NET Framework require changes to your code. 您也可能想要利用 .NET Framework 4.5 及其小數點版本、.NET Framework 4.6 及其小數點版本、.NET Framework 4.7 及其小數點版本或 .NET Framework 4.8 中的某些新功能。You may also want to take advantage of functionality that is new in .NET Framework 4.5 and its point releases, in .NET Framework 4.6 and its point releases, in .NET Framework 4.7 and its point releases, or in .NET Framework 4.8. 針對新版 .NET Framework 對您應用程式所做之這些類型的變更通常稱為「移轉」。Making these types of changes to your app for a new version of the .NET Framework is typically referred to as migration. 如果您的應用程式不必移轉,您可以在 .NET Framework 4.5 或更新版本中執行它,而不需要重新編譯。If your app doesn't have to be migrated, you can run it in the .NET Framework 4.5 or a later version without recompiling it.

移轉資源Migration resources

將您的應用程式從舊版 .NET Framework 移轉至 4.5、4.5.1、4.5.2、4.6、4.6.1、4.6.2、4.7、4.7.1 或 4.7.2 或 4.8 之前,請先檢閱下列文件:Review the following documents before you migrate your app from earlier versions of the .NET Framework to version 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, or 4.8:

  • 請參閱版本和相依性,了解每個 .NET Framework 版本的基礎 CLR 版本,並檢閱成功設定應用程式目標的方針。See Versions and Dependencies to understand the CLR version underlying each version of the .NET Framework and to review guidelines for targeting your apps successfully.

  • 請參閱應用程式相容性,瞭解可能影響應用程式的執行時間和重定變更,以及如何處理它們。Review Application compatibility to find out about runtime and retargeting changes that might affect your app and how to handle them.

  • 檢閱類別庫中已淘汰的功能,以判斷您的程式碼中可能已淘汰的任何類型或成員,以及建議的替代做法。Review What's Obsolete in the Class Library to determine any types or members in your code that have been made obsolete, and the recommended alternatives.

  • 如需想要新增至應用程式之新功能的描述,請參閱新功能See What's New for descriptions of new features that you may want to add to your app.

請參閱See also