NET Core, UWP, Nuget

NET Core, UWP, Nuget

.NET Core, UWP, NuGet INNOVATION 2.0 ■ .NET Core MicrosoftMicrosoft starts starts to to callcall it itsimply simply .NET .NET 5 5 ■ .NET Standard ■ UWP ■ NuGet Packages ■ .NET on Linux .NET 5 - A Unified Platform ■ various tech stacks ■ .NET Framework ■ .NET Core ■ .NET Xamarin ■ .NET Mono ■ .NET 5 ■ towards one Standard Library ■ 5.0 Actual Version https://appdevelopermagazine.com/looking-at-the-future-of-.net/ School of Engineering © K. Rege, ZHAW 2 von 96 … .NET 5 - A Unified Platform ■ .NET 5 is the next step towards a unified plattform ■ Produce a single .NET runtime and framework that can be used everywhere ■ Take the best of .NET Core, .NET Framework, Xamarin and Mono. ■ Build that product out of a single code-base ■ Open source and community-oriented on GitHub. ■ Cross-platform implementation ■ Side-by-side installation ■ Capable command-line interface (CLI). School of Engineering © K. Rege, ZHAW 3 von 96 .NET Framework Evolution ■ The .NET Framework library has evolved Mono Project during the years ■ Open Source Variant of .NET ■ gestartet 2004 ■ Goal: Run Microsoft .NET applications cross-platform ■ Better development tools to Linux developers. ■ Mono can be run on many platforms ■ Android, most Linux distributions, ■ BSD, macOS, Windows, Solaris, and even some game consoles such as PlayStation 3, Wii, and Xbox 360. ■ Current status ■ .NET 4.7.2 is supported ■ .NET Standard 2.1 supported .NET 1.NET 2 .NET School of Engineering © K. Rege, ZHAW 4 von 96 Xamarin ■ Xamarin is a Microsoft owned San Francisco-based software company ■ Founded in May 2011 by Mono engineers ■ Xamarin library based heavily on Mono ■ Xamarin.Forms using C# and XAML that is multi platform -> XAML Flavour ■ Xamarin is a technology that allows to develop native apps for multiple platforms ■ Using a single C# codebase and .Net. ■ common code can be shared and reused, allowing to reduce the codebase . ■ Microsoft has defined a cross platform ".Net Standard" ■ but only Xamarin Forms provides portable GUIs yet https://docs.microsoft.com/en-us/xamarin/get-started/supported-platforms School of Engineering © K. Rege, ZHAW 5 von 96 What about the UI ■ There is a different UI library on each platform ■ in the .Net Ecosystem still an issue. ■ On Windows, we find WPF (Windows Presentation Foundation) and WinForms, also for Core ■ On Linux and macOS (and also Windows) we have GtkSharp. XAML XAML “flavors” “flavors” ■ Xamarin.Forms (XAML based) ■ iOS, Android, macOS and UWP since Core 3.0 School of Engineering © K. Rege, ZHAW 6 von 96 … What about the UI https://docs.microsoft.com/en-us/windows/desktop/choose-your-technology School of Engineering © K. Rege, ZHAW 7 von 96 .NET 6 Multi-platform App UI (MAUI) ■ .NET Multi-platform App UI ■ Supported with .NET 6 (LTS) ■ An evolution/replacement of Xamarin.Forms ■ Xamarin.Forms will continue to receive service releases through November 2022 ■ Xamarin XAML “flavor” in .NET MAUI. JavaJava Applets Applets ■ Cross-platform: Android, iOS, and UWP. revivedrevived ■ Suitable for reuse by other frameworks such as Blazor ■ Support in Blazor Desktop in .NET 6. ■ Full-App Themes through styling for Fluent UI and Material Design ■ Fluent Design originated by Microsoft with Win 8 (Metro) Fluent ■ Material Design originated by Google for Android (2015) ■ Rege Design originated by K. Rege for Waikiki ■ New Visual strategy ■ A combination of native controls and drawn controls JavaJava Swing Swing LookLook and and Feel Feel Material waikiki School of Engineering © K. Rege, ZHAW 8 von 96 Class Library Variants (shown in VS 17) ■ Build new Class Library Project ■ .NET Framework ■ uses the full .NET 4.x Framework classes ■ .NET Core -> .NET 5 ■ uses the Core Framework classes ■ increases API surface area of your library ■ only .NET Core Apps are compatible ■ .NET Standard ■ runs on any standard compatible framework ■ such as .NET Core, .NET Framework, Mono/Xamarin ■ more Apps that will be compatible ■ decreases API surface area compatible to your library ■ Legacy Portable ■ target a specific subset of .NET implementation. ■ strongly discourage their use in new application ■ ■ To install other projects goto link below Universal Windows ■ target a very UWP specific implem. Subset ■ + the number of Apps that will be compatible ■ Native (i.e. WIN32) ■ for C++ Libraries only https://dotnet.microsoft.com/download/visual-studio-sdks?utm_source=getdotnetsdk&utm_medium=referral School of Engineering © K. Rege, ZHAW 9 von 96 School of Engineering © K. Rege, ZHAW 10 von 96 Benefits of .NET Core ■ .NET Core (codename .NET vNext) ■ first introduced in 2014 ■ Open Source ■ The main benefits are: School of Engineering © K. Rege, ZHAW 11 von 96 … Benefits of .NET Core ■ Compatibility: ■ .NET Core: provides a portable subset of the .NET Framework ■ Class Libraries: CoreFX ■ smaller footprint than standard libraries ■ Performance and Scalability: ■ NET Core: enhance the performance and scalability due to wider platform support ■ Deployment Options: ■ .NET Framework: Internet Information Server only ■ .NET Core: directly in the cloud or self-host the application by creating own hosting process. ■ Framework -Dependent Deployment (FDD) ■ .NET Core SDK has to be installed on machine beforehand ■ Self-Contained Deployment (SCD) ■ .NET Core CLR and class library as part of application package School of Engineering © K. Rege, ZHAW 12 von 96 … Benefits: RyuJIT Compiler ■ New JIT Compiler (Byte Code to Machine Code) ■ more efficient native machine code ■ is 100% faster than previous version RoslinRoslin for for C# C# to to ■ generated 30% faster code BytecodeBytecode ■ supports X64 and X86 architectures ■ Profile guided optimization ■ Records information about code execution ■ This information is used for optimize code generation ■ Similar to Java's Hotspot approach but separated optimization step School of Engineering © K. Rege, ZHAW 13 von 96 … Benefit: Designed for Microservices ■ Azure App Service ■ For stateless microservices. ■ -> Fowler GoTo 2014 Talk https://www.youtube.com/watch?v=wgdBVIX9ifA ■ Based on Docker ■ Can be hosted in your own Linux or Windows infrastructure, ■ A cloud service such as Azure Container Service. ■ Azure Service Fabric ■ for large and complex microservice systems ■ superseded by AKS ■ Azure Kubernetes Service (AKS) https://azure.microsoft.com/en-us/services/kubernetes-service/ https://docs.microsoft.com/en-us/azure/aks/ School of Engineering © K. Rege, ZHAW 14 von 96 … Benefit: Another Application Model ■ Adds Another Application Model ■ .NET Framework: for Windows Forms, ASP.NET, and WPF. ■ NET Core: Windows Universal Apps and ASP.NET Core School of Engineering © K. Rege, ZHAW 15 von 96 When to Use .NET Core ■ Use .NET Core for your server application when: ■ You have cross-platform needs. ■ You are targeting microservices. ■ You are using Docker containers. ■ You need high-performance and scalable systems. ■ You need side-by-side .NET versions per application. ■ Use .NET Framework when: ■ Your App currently uses .NET Framework (recommendation is to extend instead of migrating). ■ Your App uses third-party .NET libraries or NuGet packages not available for .NET Core. ■ Your App uses .NET technologies that aren't available for .NET Core. ■ e.g. Registry,Win Forms, COM ■ Your app uses a platform that doesn’t support .NET Core. https://docs.microsoft.com/en-us/dotnet/standard/choosing-core-framework-server School of Engineering © K. Rege, ZHAW 16 von 96 Upgrade Path to .NET Core School of Engineering © K. Rege, ZHAW 17 von 96 Core Hello World School of Engineering © K. Rege, ZHAW 18 von 96 .NET Core Installation ■ Use of Version 5.0 https://dotnet.microsoft.com/download/dotnet/5.0 School of Engineering © K. Rege, ZHAW 19 von 96 Hello World Application with VS 19 ■ File > New > Project -> Console App (.NET Core) https://docs.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio School of Engineering © K. Rege, ZHAW 20 von 96 … Hello World Application Build and Run ■ Application template automatically defines a class, Program, with a single method, Main ■ To keep Console Window open add to generated main Method, eventually Console.Write("PressConsole.Write("Press anyany keykey toto continue...");continue..."); Console.ReadKey(true);Console.ReadKey(true); ■ And press start School of Engineering © K. Rege, ZHAW 21 von 96 Hello World Application with CLI ■ Simply start a new console and create a new directory, type > dotnet --list-sdks define global.json -> default dnet-version > dotnet new globaljson --sdk-version 5.0.200 define global.json -> default dnet-version toto be be used used when when you you run run .NET .NET Core Core CLI CLI command > dotnet new console command > dotnet run Hello World! ■ Generated files Run in Command Line directly using System; > dotnet hello.dll namespace temp { class Program { or static void Main(string[] args) { Console.WriteLine("Hello World!"); > hello.exe } } } <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>net5.0</TargetFramework> </PropertyGroup> </Project> https://docs.microsoft.com/en-us/dotnet/standard/frameworks School of Engineering © K. Rege, ZHAW 22 von 96 Universal Windows Platform ■ A single, guaranteed (same) API Surface ■ The same on all devices School of Engineering © K. Rege, ZHAW 23 von 96 … DOTNET CLI commands ■ CLI command structure consists of ■ the driver ("dotnet"), ■ the command (or "verb"), ■ and possibly command arguments and options. ■ Example greate, build and run https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet?tabs=netcore21

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    96 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us