Top Banner
Modern .NET Ecosystem Andrei Marukovich LunarFrog.com twitter: @amarukovich
18

Modern .NET Ecosystem

Jan 24, 2018

Download

Software

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Modern .NET Ecosystem

Modern .NET Ecosystem

Andrei Marukovich

LunarFrog.com

twitter: @amarukovich

Page 2: Modern .NET Ecosystem

Agenda

• .NET Standard

• VS 2017 and .NET Core tooling

• Usage in practice

Page 3: Modern .NET Ecosystem

.NET ecosystem

.NET Framework .NET Core Xamarin

WPF

ASP.NET

WinForms UWP

ASP.NET Core

iOS

macOS

Android

Page 4: Modern .NET Ecosystem

Code sharing and library types

• Source file links

• Shared projects

• Portable class libraries (PCLs)

• .NET Standard

Page 5: Modern .NET Ecosystem

Shared projects

• Better version of the source file links

UWP project Xamarin project

File1.csFile2.cs

SharedLib

File1.csFile2.cs

SharedLib

File1.csFile2.cs

SharedLibUI

App layer

UI

App layer

Page 6: Modern .NET Ecosystem

Portable class libraries

• Sharing code in binary form, without recompiling

UWP project Xamarin project

File1.csFile2.cs

PortableLib

UI

App layer

UI

App layer

Page 7: Modern .NET Ecosystem

How it works?

• PCLs are based on profiles

• Profile defines an API surface supported by the library

• Profile is identified by combination of supported platforms• http://embed.plnkr.co/03ck2dCtnJogBKHJ9EjY

• C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\

Page 8: Modern .NET Ecosystem

UWP

Profile API surface

XamarinAndroid

.NET Framework

Page 9: Modern .NET Ecosystem

.NET Standard

Page 10: Modern .NET Ecosystem

.NET Standard

• An evolution of PCLs, recommended approach for new libraries*

• Defines a set of APIs to be implemented by .NET platforms (specification)

• Is versioned (API level)

• Version defines API surface, not supported frameworks• The higher the version, the more APIs you have

• The lower the version, the more .NET platforms implement it

• Library developers may choose target .NET Standard version

Page 11: Modern .NET Ecosystem

.NET platform support

http://github.com/dotnet/standard

Page 12: Modern .NET Ecosystem

.NET Standard 2.0

Page 13: Modern .NET Ecosystem

Big picture

Page 14: Modern .NET Ecosystem

.NET Standard

• Current state• Tooling is in preview

• Currently PCLs support a wider range of platforms

• At the moment, PCL adoption (# of libraries) is higher than .NET Standard

• Future• PCL replacement

• Standard 2.0 will have significantly larger API surface

• Standard 2.0 will be interoperable with .NET Framework

Page 15: Modern .NET Ecosystem

Visual Studio 2017 demo

Page 16: Modern .NET Ecosystem

Recap

• .NET Standard is the future

• project.json is obsolete

• .csproj, msbuild and NuGet play nicely together

Page 17: Modern .NET Ecosystem

Additional information

• Additions to the csproj format for .NET Core• https://docs.microsoft.com/en-us/dotnet/articles/core/tools/csproj

• NuGet pack and restore as MSBuild targets• https://docs.microsoft.com/en-us/nuget/schema/msbuild-targets

• How to use new features of MSBuild 15 with .NET Framework projects• http://lunarfrog.com/blog/how-to-use-msbuild15-net-framework

Page 18: Modern .NET Ecosystem

Thank you!

Andrei Marukovich

[email protected]

twitter: @amarukovich