Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Cross-Platform .NET Development

Cross-Platform .NET Development

NOTE: description is updated with newer details coming for a future talk. Also there are number of slides in here that appear as just screenshots that are actually videos in the live presentation.

The sky must be filled with flying pigs because for the first time ever web developers are now able to run true ASP.NET applications across Windows, Mac, and Linux. With the release of ASP.NET 5, Microsoft has finally done the right thing and have open-sourced the entire ASP.NET 5 stack and are heavily focused on the developer community.

It’s true that many a developer will be quick to laugh off ASP.NET as an unfit weapon for their arsenal amongst the Rubies, Pythons, PHPs, and JavaScripts, but I am here to urge you to forget the WebForms’ past and take a close look at what the modern flavor of ASP.NET offers.

During this session I am focusing exclusively on getting ASP.NET up and running on our beloved MacBooks. We will start from the ground up and take a look at setting up your development environment, scaffolding applications with Yeoman, comparing the different code editor options, and running and hosting locally as well as remote hosting options. During the process we will create a small MVC web app that exposes a simple web API. You will learn about various aspects of the ASP.NET ecosystem and the C# language spanning from basic data types to working with data via Entity Framework.

Avatar for Myke Bates

Myke Bates

August 07, 2015
Tweet

More Decks by Myke Bates

Other Decks in Technology

Transcript

  1. 3

  2. • New workflows and technologies • New market opportunities •

    Platform diversification • Server consolidation(less of $$$) • New developers • New era 5
  3. 7

  4. .NET Core • Modular runtime and library implementation • Includes

    a subset of the .NET Framework • OS X and Linux still in progress • Distributed via NuGet • Portable 8
  5. 15

  6. Command Line Tools • Homebrew • Node.js + NPM •

    Yeoman • DNVM • DNX • DNU 16
  7. Brew Tap brew tap aspnet/dnx brew update brew install dnvm

    Add dnvm to your bash profile (./bash_profile) source dnvm.sh 21
  8. 22

  9. DNVM .NET Version Manager • Download versions of .NET Execution

    Environment(DNX) • Easily switch between DNX versions 23
  10. DNX .NET Execution Environment • Contains the code required to

    bootstrap and run an application - dnx . kestrel • If installed with DNVM, DNX is in your path • No more "design time" (blur the lines between compilation and loading)... • Run custom commands 24
  11. DNU DNX Utility • Responsible for all operations involved with

    packages in your application. • Restore, Install, Publish, Build, List, etc 25
  12. yo aspnet • Empty Application • Console Application • Web

    Application • Web Application Basic [without Membership and Authorization] • Web API Application • Nancy ASP.NET Application • Class Library • Unit test project 26
  13. Yo, what's up • Equivalent to a File->New Project •

    Bootstraps the project template with fresh files • Gulp - swappable with Grunt • Default config and tasks • Ready to rock and roll 27
  14. 29

  15. Note If you have previously installed the Yeoman aspnet generator

    you will want to make sure you run the install again to get the latest version npm install -g generator-aspnet 30
  16. 32

  17. 34

  18. Current Pitfalls • Bugs, obviously • No debugging • Heavy

    reliance on Mono • No data persistence • No auto compilation1 • Kestrel difficult to kill 1 GitHub Issue 35
  19. Visual Studio Code • More text editor than IDE •

    Extremely lightweight & fast • Clean and minimal UI • Intellisense • Actually formats code well • Flexible • JavaScript • Git • Commands & Tasks 36
  20. Let's see something real • Add Json.NET to project.json •

    Run a restore • Setup a quick home route to return some json • Run kestrel to see result 37
  21. 38

  22. Tip Until auto compilation is working properly via dnx you

    can use a technique suggested by John Papa And then run dnxmon . kestrel This will automatically restart kestrel on file save 39
  23. Roadmap Beta7 - Cross-platform - Aug 24 The primary focus

    for Beta7 will be to enable cross-platform development on .NET Core. This includes shipping the .NET Core based .NET Execution Environments for Mac and Linux, enabling the basic developer workflows and also setting up the acquisition story. Planned features: Runtime, MVC, Razor, Identity 40
  24. Roadmap Beta8 - Feature complete! - Sept 21 Beta8 is

    the last major feature milestone planned before moving into a stabilization phase for RC1. We will work on enabling complete end-to-end experiences in Visual Studio and Visual Studio Code. We expect cross-platform .NET Core to be feature complete at this point. Planned features: Runtime, MVC, Razor, Identity 41
  25. Roadmap RC1 - Stabilization - Nov The focus for RC1

    will be on polishing existing features, responding to customer feedback and improving performance and reliability. The goal is for RC1 to be a stable and production ready release. 42
  26. Roadmap Future Work The following features unfortunately won't make it

    into the initial RTM release. We are tentatively planning on shipping them in the initial feature release after RTM, during Q3* of 2016: Visual Basic support, SignalR 3, Web Pages 4 43
  27. Future for ASP.NET development • More desirable for those reluctant

    devs • Huge advantage for CMSs and other platforms • Alternative workflows • New tooling otherwise never available in Windows 45
  28. Resources ASP.NET Github .NET Core .NET Core Documentation .NET Foundation

    Projects Visual Studio Code API Portability Analyzer Music Store Project Music To Code To - Carl Franklin 47