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

Modern .NET Ecosystem

Embed Size (px)

Citation preview

Modern .NET Ecosystem

Andrei Marukovich

LunarFrog.com

twitter: @amarukovich

Agenda

• .NET Standard

• VS 2017 and .NET Core tooling

• Usage in practice

.NET ecosystem

.NET Framework .NET Core Xamarin

WPF

ASP.NET

WinForms UWP

ASP.NET Core

iOS

macOS

Android

Code sharing and library types

• Source file links

• Shared projects

• Portable class libraries (PCLs)

• .NET Standard

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

Portable class libraries

• Sharing code in binary form, without recompiling

UWP project Xamarin project

File1.csFile2.cs

PortableLib

UI

App layer

UI

App layer

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\

UWP

Profile API surface

XamarinAndroid

.NET Framework

.NET Standard

.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

.NET platform support

http://github.com/dotnet/standard

.NET Standard 2.0

Big picture

.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

Visual Studio 2017 demo

Recap

• .NET Standard is the future

• project.json is obsolete

• .csproj, msbuild and NuGet play nicely together

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

Thank you!

Andrei Marukovich

[email protected]

twitter: @amarukovich