- C# 7 and .NET Core 2.0 High Performance
- Ovais Mehboob Ahmed Khan
- 265字
- 2021-08-27 18:47:08
Compatibility mode
Although more than 33K APIs have been added into .NET Standard 2.0, many of the NuGet packages still target .NET Framework, and moving them to .NET Standard is not possible, since their dependencies are still not targeted at .NET Standard. However, with .NET Standard 2.0, we can still add packages which show a warning but don't block adding those packages into our .NET Standard library.
Under the hood, .NET Standard 2.0 uses compatibility shim, which solves the third party library compatibility issue and makes it easy in referencing those libraries. In the CLR world, the identity of the assembly is part of the type identity. This means that when we say System.Object in .NET Framework, we are referencing [mscorlib]System.Object and with .NET Standard, we are referencing [netstandard]System.Object, so if we are referencing any assembly which is part of .NET Framework, it cannot be easily run on .NET Standard and so compatibility issues arise. To solve this problem, they have used type forwarding which provides a fake mscorlib assembly that type forwards all the types to the .NET Standard implementation.
Here is a representation of how the .NET Framework libraries can run in any of the .NET Standard implementations using the type forwarding approach:

On the other hand, if we have a .NET Framework library and we wanted to reference a .NET Standard library, it will add the netstandard fake assembly and perform type forwarding of all the types by using the .NET Framework implementation:

- 同步:秩序如何從混沌中涌現
- Unity 5.x Game AI Programming Cookbook
- Python金融大數據分析(第2版)
- Access 2007數據庫應用上機指導與練習
- Access 2016數據庫技術及應用
- 數據要素五論:信息、權屬、價值、安全、交易
- iOS and OS X Network Programming Cookbook
- 企業級數據與AI項目成功之道
- 數據科學工程實踐:用戶行為分析與建模、A/B實驗、SQLFlow
- INSTANT Android Fragmentation Management How-to
- 聯動Oracle:設計思想、架構實現與AWR報告
- 活用數據:驅動業務的數據分析實戰
- SIEMENS數控技術應用工程師:SINUMERIK 840D-810D數控系統功能應用與維修調整教程
- 改進的群智能算法及其應用
- Hands-On Deep Learning for Games