官术网_书友最值得收藏!

.NET Standard and .NET Native

As we saw previously, UWP using the .NET Framework utilizes .NET Standard. .NET Standard is used as the common BCL (base class library), while the Core Common Language Runtime (Core CLR) is responsible for executing the modules that are implemented by .NET Standard. Besides .NET Core and .NET Standard, another .NET concept is invaluable for Universal Windows Applications: .NET Native.

.NET Native provides a set of tools that are responsible for generating native code from .NET applications for UWP, bypassing the intermediate language. Using the .NET Native toolchain, .NET Standard class libraries, as well as the common language runtime infrastructure modules such as garbage collection, are linked to smaller, dynamic link libraries (similar to the Xamarin build process for iOS and Android).

In order to enable the native compilation, you need to enable the .NET Native tool chain for the current configuration (for example, Release x64), which will be used for preparing the appx package in the application, as well as the appx bundle that will need to be created for the supported architectures (ARM, x86, and x64):

During the linking process, several actions are executed:

  • Certain code paths that utilize reflection and metadata are replaced with static native code
  • Eliminates all metadata (where applicable)
  • Links out the unused third-party libraries, as well the .NET Framework class libraries
  • Replaces the full common language runtime with a refactored version that primarily includes the garbage collector

As a result, similar to .NET Core runtime applications (with a specified platform target), UWP applications can be cleaned up from direct dependencies to the .NET Framework by means of converting these dependencies into local references for the application itself. This, in turn, reflects on the application as performance and portability enhancements.

主站蜘蛛池模板: 西藏| 礼泉县| 聂拉木县| 克什克腾旗| 正蓝旗| 理塘县| 泉州市| 施秉县| 青阳县| 历史| 淮阳县| 衡水市| 炎陵县| 伽师县| 瑞金市| 手游| 翁源县| 临潭县| 咸宁市| 壤塘县| 义乌市| 织金县| 深泽县| 烟台市| 越西县| 南华县| 广德县| 永福县| 清流县| 洪洞县| 保山市| 峨边| 黄山市| 北碚区| 德令哈市| 当雄县| 嘉祥县| 定南县| 汪清县| 彝良县| 庆阳市|