.NET Core vs .NET Standard vs PCL vs UWP vs Compact Framework

πŸ’‘ Concept Name

Comparison of .NET Platforms: Core, Standard, PCL, UWP, Compact

πŸ“˜ Quick Intro

Microsoft has introduced several frameworks for .NET over time. Each has a specific purpose β€” some for compatibility, others for performance or cross-platform support. Knowing the differences helps you pick the right one for your application or library.

🧠 Analogy / Short Story

Imagine different kinds of plugs and adapters. Some work in all countries (like .NET Standard), some are specialized for one (like UWP), some outdated (like Compact Framework), and others are modern and universal (like .NET Core). Each has a reason for existence, but only a few are still useful today.

πŸ”§ Technical Explanation

Here's a breakdown:

  • .NET Core: Modern, cross-platform runtime for web, cloud, APIs
  • .NET Standard: Specification for shared APIs across all .NET runtimes
  • PCL (Portable Class Library): Legacy way to create libraries for multiple platforms (restricted)
  • UWP (Universal Windows Platform): Framework for Windows 10 device apps (now legacy)
  • .NET Compact Framework: Legacy framework for embedded/mobile devices like Windows CE

🎯 Purpose & Use Case

  • βœ… Use .NET Core (or .NET 5/6/7+) for all new applications
  • βœ… Use .NET Standard only if you want to share code with older frameworks
  • 🚫 Avoid PCL β€” it’s obsolete
  • 🚫 Avoid UWP β€” use .NET MAUI or WinUI for modern Windows apps
  • 🚫 Avoid .NET Compact β€” it's deprecated

πŸ’» Real Code Example

Example of targeting a .NET Standard library:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
  </PropertyGroup>
</Project>

❓ Interview Q&A

Q1: What is .NET Core used for?
A: Building cross-platform modern apps like APIs, web apps, and microservices.

Q2: Is .NET Standard an implementation?
A: No, it's a specification.

Q3: What replaced Portable Class Library (PCL)?
A: .NET Standard

Q4: What is UWP mainly used for?
A: Windows 10 device applications

Q5: Is .NET Compact Framework still supported?
A: No, it's deprecated

Q6: Which version is ideal for shared libraries across .NET Core and Framework?
A: .NET Standard 2.0

Q7: Can you create new projects using PCL today?
A: No, it's outdated

Q8: What is the future of .NET Core?
A: It's been unified into .NET 5/6/7+

Q9: Which is better: UWP or MAUI?
A: MAUI is better for modern development

Q10: What is the major benefit of .NET Core?
A: Cross-platform development and performance

πŸ“ MCQs

Q1. Which one is a runtime, not a specification?

  • .NET Standard
  • PCL
  • .NET Core
  • XAML

Q2. What does .NET Standard define?

  • Memory rules
  • JIT compiler
  • A set of common APIs
  • UWP packaging

Q3. Which is obsolete today?

  • .NET Core
  • PCL
  • .NET 5
  • MAUI

Q4. Which is suitable for embedded devices?

  • .NET Core
  • UWP
  • .NET Compact Framework
  • PCL

Q5. Which replaced PCL?

  • .NET Core
  • .NET MAUI
  • .NET Standard
  • Xamarin

Q6. Which one supports cross-platform development?

  • .NET Framework
  • .NET Compact
  • .NET Core
  • UWP

Q7. Which one is not used to build apps?

  • .NET Core
  • UWP
  • .NET Standard
  • .NET Compact

Q8. Which one is Windows-only?

  • .NET Core
  • .NET Framework
  • .NET MAUI
  • .NET 6

Q9. What is the preferred approach for modern Windows UI?

  • PCL
  • UWP
  • WinUI / MAUI
  • .NET Compact

Q10. What is the target framework moniker for .NET Standard 2.0?

  • netcore2.0
  • netstandard2.0
  • netfx2.0
  • net5.0

πŸ’‘ Bonus Insight

Today, prefer targeting net6.0 or higher unless you're writing libraries for older projects. .NET Standard and PCL are only for backward compatibility β€” the future is unified .NET.

πŸ“„ PDF Download

Need a handy summary for your notes? Download this topic as a PDF!

πŸ’¬ Feedback
πŸš€ Start Learning
Share:

Tags: