.NET Core vs .NET Framework vs Xamarin

πŸ’‘ Concept Name

.NET Core vs .NET Framework vs Xamarin

πŸ“˜ Quick Intro

This topic highlights the differences between the major .NET implementations and their role in desktop, web, and mobile development.

🧠 Analogy / Short Story

Think of .NET Framework as the classic family sedan, .NET Core as the high-performance hybrid for modern roads, and Xamarin as the off-road vehicle for mobile terrains. Same core principles, different terrains.

πŸ”§ Technical Explanation

  • πŸ–₯️ .NET Framework: Windows-only, mature, supports Windows Forms, WPF, ASP.NET (not Core).
  • 🌍 .NET Core: Cross-platform, high-performance, modern web apps and APIs.
  • πŸ“± Xamarin: Cross-platform mobile (iOS, Android) using C# and .NET for UI and logic.
  • πŸ”§ All three share the .NET standard libraries to some degree.
  • 🧩 With .NET 5+, .NET Core and Xamarin are merged into the unified .NET platform.

🎯 Purpose & Use Case

  • βœ… Use .NET Framework for legacy Windows desktop apps.
  • βœ… Use .NET Core for new cloud-based web apps, APIs, and CLI tools.
  • βœ… Use Xamarin to build native mobile apps with shared codebase.

πŸ’» Real Code Example

All three use similar C# syntax. Here's a simple shared logic method:

public class GreetingService {
    public string GetGreeting(string name) => $""Hello, {name}!"";
}

This method can be used in .NET Core API, .NET Framework WinForms, and Xamarin mobile apps alike.

❓ Interview Q&A

Q1: Is .NET Core cross-platform?
A: Yes, it runs on Windows, Linux, and macOS.

Q2: Which one supports mobile app development?
A: Xamarin.

Q3: Which is better for legacy desktop apps?
A: .NET Framework.

Q4: Can I share code between Xamarin and .NET Core?
A: Yes, via .NET Standard libraries.

Q5: Is .NET Framework still supported?
A: Yes, but it’s in maintenance mode.

πŸ“ MCQs

Q1. Which is cross-platform?

  • .NET Framework
  • .NET Core
  • XNA
  • Mono

Q2. Which framework supports mobile apps?

  • Xamarin
  • .NET Framework
  • .NET Core
  • Blazor

Q3. Which one is legacy?

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

Q4. Can Xamarin share logic with .NET Core?

  • No
  • Yes, using .NET Standard
  • Only through DLL
  • Via REST APIs

Q5. What platform merged everything?

  • .NET Core 2.1
  • .NET 3.5
  • .NET 5+
  • .NET Standard

πŸ’‘ Bonus Insight

.NET MAUI (Multi-platform App UI) is the evolution of Xamarin and aims to unify UI development across mobile and desktop in .NET 6+.

πŸ“„ PDF Download

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

β¬… Previous:

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

Tags: