short-training asp.net vnext

21
MAXIME LEMAITRE – 11/12/2014 asp.net vNext The future of the Server

Upload: betclic-everest-group-tech-team

Post on 07-Jul-2015

708 views

Category:

Software


0 download

DESCRIPTION

asp.net vNext is the next major version on .net on the server. It’s a completely new way to work with awesome possibilities ; It contains a new flexible and cross-platform runtime, new modular HTTP request pipeline, Cloud-ready CLR, an unified programming model that combines MVC, Web API, and Web Pages, a no-compilation dev experience, ability to self-host or host on IIS, … Best of all : it’s Open source in GitHub (https://github.com/aspnet/Home)

TRANSCRIPT

Page 1: Short-Training asp.net vNext

MAXIME LEMAITRE – 11/12/2014

asp.net vNextThe future of the Server

Page 2: Short-Training asp.net vNext

Agenda

• Before to start

• Let’s – create a new MVC project..

– open the project file …

– add a reference …

– add a nuget package …

– build a class library…

– build & publish the project…

– edit source code…

– add some configuration …

– add a web api …

– play with bower/gulp/grunt …

• asp.net core & project K

• Questions

Page 3: Short-Training asp.net vNext

Based on latest asp.net vNext version (Nov. 2014)

Page 4: Short-Training asp.net vNext

Let’s create a new MVC project …

What’s different ?• New sections

– wwwroot

– Dependencies

• New Solution structure– Src, artefacts, …

• New files– project.json

– global.json

– (package.json)

– (grunfile.js)

– (bower.json)

• Missing files/folders– MVC Content/Scripts/AppStart

– Web.config

– global.asax

Page 5: Short-Training asp.net vNext

Let’s open the project file …

What’s different ?

• K Project file is smaller– Where are references ?

– Where are source code files ?

– Where are X & Y ?

• A new project.json file– Project settings

– Dependencies & Frameworks

– Commands

– (but still no files)

Page 6: Short-Training asp.net vNext

Let’s add a reference …

What’s different ?

• No more direct dependencies

• No more GAC dependencies

• NuGet everything, even the runtime itself.

Dependencies are now defined in project.json

Page 7: Short-Training asp.net vNext

Let’s add a nuget package …

Page 8: Short-Training asp.net vNext

Let’s add a nuget package …• Brand New UI

• Version Selection

• Combined Installed/Online/Updates Workflows

• Version Consolidation

• Operation Previews

• Installation Options (Dep behavior & conflict action)

• Infinite Scrolling

• …

Page 9: Short-Training asp.net vNext

Let’s build a class library …

• New project type• Nuget packages “All the way”• Cross compiling (net40, net45,

aspnet, aspnetcore, …)• Can be built via command line

or VS

Page 10: Short-Training asp.net vNext

Let’s build & publish the project …

• What about the deployable package ?– the assemblies never exist on the disk

– the compiler do all the work in memory

Tip : > SET KRE_TRACE=1

• Same experience between command prompt and VS

• Cross-platform

Page 11: Short-Training asp.net vNext

Let’s edit source code …

vNext uses the Rosyln compiler to compile code dynamically. You will be able to edit a code file, refresh the browser, and see the changes without rebuilding the project.

No-compiledeveloperexperience !

Page 12: Short-Training asp.net vNext

Let’s add some configuration …

• No more .config file ! But a new lightweight model– Configuartion that works everywhere (Core & Full CLR)

– Configuration can be instantiated and initialized by the application

Tip : ConfigR may help… Program.cs

Project.json

Config.ini

Config.xmlConfig.json

Supports also command line arguments & environement variables !

Page 13: Short-Training asp.net vNext

Let’s add a web api …

• MVC, Web API, and Web Pages will be merged into one framework, called MVC 6– removes a lot of overlap between

the existing MVC and Web API frameworks

– uses a common set of abstractions for routing, action selection, filters, model binding, and so on

– use the framework to create both UI (HTML) and web APIs.

• No dependency to System.Web– leaner framework, with faster

startup time and lower memory consumption

Page 14: Short-Training asp.net vNext

Let’s play with bower/gulp/grunt …• VS 2015 Preview has built-in support for popular

package managers – Bower. Described as a “package manager for the

web,” Bower lets you install and restore client-side packages, include JavaScript and CSS libraries.

– Grunt and Gulp. Grunt and Gulp are JavaScript-based task runners.

– npm : npm is a package manager that was originally created for Node.js. Bower, Grunt, and Gulp all use npm.

• wwwroot folder– All of the static files (generated or not) in your

project go into this folder

Page 15: Short-Training asp.net vNext

Microsoft’s Special K

• KRE – K Runtime Environment is the code required to bootstrap and run an ASP.NET vNext application. This includes things like the compilation system, SDK tools, and the native CLR hosts.

• KVM – K Version Manager is for updating and installing different versions of KRE. KVM is also used to set default KRE version.

• KPM – K Package Manager manages packages needed by applications to run. Packages in this context are NuGet packages.

Read more here

Page 16: Short-Training asp.net vNext

Levels of abstractions

• The host application – in the past this was ALWAYS Microsoft Internet Information Server (IIS). This could be IIS, IIS with Helios, Katana, or some other OWIN capable host.

• The CLR framework – previously you would choose which version of the Microsoft.NET framework you wanted to use. This may be .NET 4.5.2, K runtime, or Mono.

• The Application Host – previously, this would be the W3C executable. Now, this can be a host for the Visual Studio designer, or the new Microsoft.Host.Runtime.

• Your Application – Your application now loads the former ASP.NET frameworks (MVC, WebAPI, or SignalR) as part of its dependencies.

Read more here

Page 17: Short-Training asp.net vNext

• New flexible and cross-platform runtime• New modular HTTP request pipeline• Cloud-ready environment configuration• Unified programming model that combines MVC, Web API,

and Web Pages• Ability to see changes without re-building the project• Side-by-side versioning of the .NET Framework• Ability to self-host or host on IIS• New tools in Visual Studio 2015• Open source in GitHub

Asp.net vNext Features

Read more here

Page 18: Short-Training asp.net vNext

Questions

Page 19: Short-Training asp.net vNext

Continue reading …

• http://www.asp.net/vnext/overview/aspnet-vnext

• http://channel9.msdn.com/Events/Visual-Studio/Connect-event-2014/011

• http://www.tugberkugurlu.com/archive/exciting-things-about-asp-net-vnext-series-the-ultimate-guide

• https://github.com/aspnet/Home/wiki

• https://github.com/aspnet/Home/wiki/KRuntime-structure

• http://www.hanselman.com/blog/IntroducingASPNETVNext.aspx

• http://stackoverflow.com/questions/25431750/asp-net-vnext-is-host-agnostic-what-does-it-deeply-mean

• http://channel9.msdn.com/Events/dotnetConf/2014/ASP-NET-vNext-101

• http://channel9.msdn.com/Events/Visual-Studio/Connect-event-2014/023

• http://jeremydmiller.com/2014/12/02/some-thoughts-on-the-new-net/?utm_source=twitterfeed&utm_medium=twitter

• http://gunnarpeipman.com/aspnet/

• http://www.omnisharp.net/

Page 20: Short-Training asp.net vNext

About Us• Betclic Everest Group, one of the world leaders in online

gaming, has a unique portfolio comprising variouscomplementary international brands: Betclic, EverestPoker/Casino, Bet-at-home, Expekt, Imperial Casino, Monte-Carlo Casino…

• Through our brands, Betclic Everest Group places expertise,technological know-how and security at the heart of ourstrategy to deliver an on-line gaming offer attuned to thepassion of our players. We want our brands to be easy to usefor every gamer around the world. We’re building ourcompany to make that happen.

• Active in 100 countries with more than 12 million customersworldwide, the Group is committed to promoting secure andresponsible gaming and is a member of several internationalprofessional associations including the EGBA (EuropeanGaming and Betting Association) and the ESSA (EuropeanSports Security Association).

Page 21: Short-Training asp.net vNext

We want our Sports betting, Poker, Horse racing andCasino & Games brands to be easy to use for everygamer around the world. Code with us to make thathappen.

Look at all the challenges we offer HERE

Check our Employer Page

Follow us on LinkedIn

WE’RE HIRING !