2. Bertrand Le Roy
▪ Senior Program Manager on .NET Core
▪ One of the founders of Orchard
▪ http://weblogs.asp.net/bleroy
▪ https://blogs.msdn.microsoft.com/dotnet/tag/week-in-net/
▪ https://www.youtube.com/channel/UCvtT19MZW8dq5Wwfu6B0oxw
3. Objectives
▪ What’s .NET Core and when to use it (or not)
▪ How to create a new library, ASP.NET, or console application
▪ How to port existing code
6. .NET Framework 4.6
▪ .NET implementation for any scenario on Windows with comprehensive library
support
7. .NET Core
▪ Modular and smaller implementation of .NET
▪ Cross-platform
▪ App-level isolation
▪ Built in the open
▪ Optimized for specific workloads
▪ Built for the next ten years of software development
8. Next gen JIT (RyuJIT)
SIMD
Runtime
Components Compilers
Languages innovation
.NET Compiler Platform
.NET Core 5 Libraries
.NET Framework 4.6 Libraries
NuGet packages
.NET Framework 4.6 .NET Core
What’s common, and what’s not?
12. Managing expectations
▪ This is very much a new platform with a known flavor
▪ There is a cost to migration
▪ There are things to learn
▪ Not all projects can or should migrate
13. Should I migrate my project?
Cannot:
▪ WPF, WinForms, unless UWP
▪ ASP.NET WebForms
Should (absolutely):
▪ General purpose libraries
Should (maybe):
▪ ASP.NET MVC
▪ Micro-services
▪ Console apps
▪ Rewrite
▪ Talent expertise on Linux
15. Dependencies
▪ Most fundamental libraries first: test frameworks, tooling, data access, JSON,
logging, IoC, etc.
▪ Go to the source, ask the author
▪ Offer to help, or fork
▪ Switch to another Core-compatible library
▪ DIY
16. Testing
▪ xUnit was first, now NUnit, MsTest
▪ Secondary test libraries (mocking, functional testing, etc.) in progress
18. Tooling
Your choice of tool, on your choice platform
▪ Visual Studio on Windows
▪ Visual Studio Code on Mac, Linux, or Windows
▪ vi or emacs with OmniSharp
▪ etc.
Innovation: Innovate and deliver much fasterPrompt audience about their favorite pas innovation from .NET. Quote Roslyn, Linq, async/await, generic implementation.
Openness enriches the platform and the community
On any device and platform
Core is different from .NET Framework, and Core is also not .NET Fx 5.
Open: not just the source: design documents, code reviews, experiments, roadmaps
Open contributions with quality standards, in particular in terms of security.
Windows-specific: at least for now, as platform-specific libraries will appear.
WPF, WinForms, even if the application isn’t going cross-platform, stay on .Net Fx. A migration to UWP is possible, but that means a rewrite of the UI in addition to the Core migration.
ASP.NET WebForms applications should remain on .NET Fx.
On the other hand, MVC applications, micro-services, console apps, and anything that can benefit in being deployed cross-platform, especially using containers, is an excellent choice.
General purpose libraries should definitely be ported and support both Core and Fx.
Open VS, go to Tools / Extensions and updates, show the portability analyzer is there.
Open FluentPath solution, right-click Fluent.IO, analyze/analyze portability -> 100%
Do the same on Fluent.IO.Windows -> 91.67%, and a detailed list of failures. Those APIs are simply not supported because Windows-specific.
Do the same with the NonPortableLibrary solution -> 97.22%. Show how the IsAbstract recommended change is to go through GetTypeInfo(). Show the html file on disk.
From the NonPortableLibrary root folder, do …\apiport.exe listOutputFormats; …\apiport.exe analyze –f .\bin\Debug –r Excel –o report.xlsx. Show the Excel report with its two tabs.
Go to http://dotnetstatus.azurewebsites.net, look for IsAbstract, show the Type and TypeInfo entries. (That’s an anomaly due to the fact that TypeInfo on .NET Framework derives from Type. Most of the TypeInfo thus show up as defined by the base.)
Go to https://packagesearch.azurewebsites.net, look for IsAbstract, show the result for System.Reflection.TypeInfo, show package name and version number.
Open the Nuget Package Explorer.+3. Click "Open a package from online feed". (screenshot)+4. Search for the name of a package in the search field and hit enter. (screenshot of result)+5. Expand the "lib" folder and look for a target subfolder that is compatible with .NET Core. (screenshot)++ TODO: Something with `dnxcore50`, `dotnet`, `netstandardlib`, ... is what you're looking for.+ + If there isn't a target subfolder compatible with .NET Core, the dependency will not run on .NET Core.
Mention JetBrains Project Rider
Dotnet build, in the case of an app, generates runnable assets by copying an executable host.
Create new portable library from VS by following the script http://aka.ms/port2core
Create new command-line app from CLI: show https://github.com/dotnet/cli/blob/master/Documentation/intro-to-cli.md