Tutorialsteacher

Follow Us

Articles
  • C#
  • C# OOP
  • ASP.NET Core
  • ASP.NET MVC
  • LINQ
  • Inversion of Control (IoC)
  • Web API
  • JavaScript
  • TypeScript
  • jQuery
  • Angular 11
  • Node.js
  • D3.js
  • Sass
  • Python
  • Go lang
  • HTTPS (SSL)
  • Regex
  • SQL
  • SQL Server
  • PostgreSQL
  • MongoDB
  • ASP.NET Core - Get Started
  • .NET Core Overview
  • ASP.NET Core Overview
  • Install .NET Core
  • Create ASP.NET Core MVC
  • Project Structure
  • wwwroot
  • Program.cs
  • Command-line Interface
  • Dependency Injection
  • Built-in IoC Container
  • Middleware
  • Add Custom Middleware
  • Configure Default File
  • Environment Variable
  • Exception Handling
  • Serving Static Files
  • Serving Static Files From Other Folder
  • Logging in .NET Core
  • Logging in ASP.NET Core
  • .NET Core Application Types
  • Code Sharing
  • Target Multiple Frameworks
Entity Framework Extensions - Boost EF Core 9
  Bulk Insert
  Bulk Delete
  Bulk Update
  Bulk Merge

Code Sharing in .NET Core

With .NET Core, we can currently develop applications with three different .NET frameworks for different platforms. The traditional or standard .NET Framework is for Windows, Mono framework for iOS, OSx and Android and .NET Core for Windows, Mac and Linux.

.NET Frameworks

These frameworks use different framework class libraries. It means code written in one framework cannot be used with other frameworks. For example, a console application developed with .NET Framework cannot run on .NET Core or vice-versa. Thus, code-sharing is not allowed.

It would be nice to write code once and share with other applications with different .NET frameworks. Isn't it?

Code Sharing

To solve this problem of code sharing, we can use the following three approaches:

  1. Create Portable Class Library
  2. Target Multiple Frameworks ASP.NET Core app
  3. Target .NET Standard

Creating portable class library to share code with other .NET frameworks is not a new thing in .NET. Learn about it here.

Learn about how to target multiple frameworks in ASP.NET Core application for code sharing in the next chapter.

TUTORIALSTEACHER.COM

TutorialsTeacher.com is your authoritative source for comprehensive technologies tutorials, tailored to guide you through mastering various web and other technologies through a step-by-step approach.

Our content helps you to learn technologies easily and quickly for learners of all levels. By accessing this platform, you acknowledge that you have reviewed and consented to abide by our Terms of Use and Privacy Policy, designed to safeguard your experience and privacy rights.

[email protected]

ABOUT USTERMS OF USEPRIVACY POLICY
copywrite-symbol

2024 TutorialsTeacher.com. (v 1.2) All Rights Reserved.