Câu hỏi phỏng vấn .NET Core
Câu hỏi

What is the difference between .NET Standard and PCL (Portable Class Libraries)?

Câu trả lời

Differences Between .NET Standard and Portable Class Libraries (PCL)

Overview

.NET Standard and Portable Class Libraries (PCL) are both designed to facilitate code sharing across different .NET platforms. However, they have significant differences in their approach and capabilities.

Portable Class Libraries (PCL)

  • Purpose: PCLs were created to allow developers to write code that can be shared across multiple .NET platforms.
  • API Availability: PCLs use a "least common denominator" approach, meaning they only include APIs that are available on all the targeted platforms. This often results in a limited set of APIs, as the more platforms you target, the fewer APIs you can use[1][3][5].
  • Recompilation: When a new platform is introduced, existing PCLs often need to be recompiled to support it. This can be cumbersome and lead to inconsistencies[1][4].
  • Platform-Specific Implementations: PCLs require Microsoft to create a new framework implementation fork for each platform, which can be complex and inefficient[1].

.NET Standard

  • Purpose: .NET Standard was introduced to provide a unified set of APIs that are consistent across all .NET platforms, including .NET Framework, .NET Core, and Xamarin[1][3][4].
  • API Availability: Unlike PCLs, .NET Standard defines a set of APIs that all .NET implementations must support. This ensures a broader and more consistent API surface across different platforms[1][3][4].
  • No Recompilation Needed: Since .NET Standard fixes the API rather than the implementation, there is no need to recompile applications when new platforms are introduced. This simplifies the development process and reduces maintenance overhead[1][4].
  • Unified Base Class Library: .NET Standard acts as a unified Base Class Library (BCL) that supports a wide range of technologies,...
middle

middle

Gợi ý câu hỏi phỏng vấn

senior

What is the difference between AppDomain , Assembly , Process and a Thread ?

senior

Explain different types of Inheritance

junior

What's the difference between SDK and Runtime in .NET Core?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào