PARTNERSHIP
The next step from Microsoft - vNext
October, 2014
Srdjan Poznic
History of ASP.NET
- Released in 2002 with VisualStudio.NET
- ASP.NET Ajax (2007)
- ASP.NET Dynamic Data (2008)
- ASP.NET MVC added (2009)
- WebAPI added (2012)
- OWIN and SignalR introduced (2013)
Current state of ASP.NET
- MVC
- WebAPI
- WebPages, WebForms
- Entity Framework
Mature enough?
Idea?
- What we can do to make .NET better on the cloud?
- What we can do to make .NET better on the hosted
environment?
- How to improve development cycle?
- …
What customers say?
- We want open-source!
- We need to deliver much faster
- We need cross-device development strategy
- My customer can’t update to new version of
framework.
- …
ASP.NET vNext
- Latest: ASP.NET vNext alpha4
(October, 6th)
- Visual Studio 14 CTP 4
(Community Technology Preview)
- .NET Framework v4.5.3
New approach
- .NET Innovation
Innovation on the core of existing and future applications
- Flexibility and agile delivery
Continuous modular releases
- Openness
Transparent, open and community driven
Goal
- Fast
- Open-source
- Modular
- Cross-platform support
- Choose editors/tools
- Faster development cycle
New builds and inside the tools
(Use pieces that you what to use)
What is new?
- All about NuGet
- New run-time engine called „K“
- Roslyn compiler
- New project system
- New configuration system
- Cloud optimized .NET (CoreCLR) takes ~11MB
Demo
New features
- Side-by-side deployment
- Exact same code is running on both machines
- no GAC
- Open source
- Cross-platform (Windows, Mac, Linux)
What is new in asp.net?
- MVC, WebAPI, WebPages 6, SignalR 3, EF 7
- MVC, Web API & Web Pages have been merged into
one
- Cloud-optimized versions of MVC, WebAPI, Web
Pages, SignalR, and EF
- Host agnostic – runs not only under IIS
What is new in asp.net?
- Removing System.Web
- Moving to OWIN middleware
- e.g. Error screen replacement
- HttpContext (minimum info in object graph)
- The result is a leaner framework, with faster startup
time and lower memory consumption.
What is new in asp.net?
- No Web.Config anymore
- No Global.asax
- No packages.xml file
- No DLLs anymore
AspNet.Loader.dll
Runtime performances
- Old HttpContext removed (~30K)
- New HttpContext (~2K)
- GC
- Faster startup time
- Lower memory
- REST vs Line Business Apps (historical reasons)
Faster development
- Change the file > Save > Refresh the browser
- Faster development (dynamic compiling)
- Cloud optimized
- Develop in cloud editors
Cloud
- Seamless transition to cloud
(Same code is running)
- Configuration
- Session
(SessionState to SessionStateProvider)
Cloud
- Cache
Azure Redis Cache / Asp.net cache
- Run/Debug in Cloud
Visual Studio Online “Monaco”
- Tracing/Logging without re-deploy
Extending application types
- Knockout
- AngularJS
- Ember
- Backbone
- …
Common improvements
- DI everywhere
- Tracing and Diagnostics
- Consistency
Dependency Injection
- Scoped/Transient/Instance/Singleton
- Scoped (per request scope):
To me, as a developer, this means
- I get all the advantages of the .NET platform
(performance, stability, security, comprehensive
API)
- The development experience of C# and Visual
Studio... with the simplicity, portability, quick
development refresh cycle and flexibility of an
interpreted web framework.
Demo
K Runtime
K
Runtime
• Find and call the CLR Native host
• Pass in arguments given to the process to the native host
Layer 0
Native processs
• Boot the CLR
• Calling the Managed Entry Point, Layer 2
Layer 1
CLR Native Host
• Create the LoaderContainer that will contain the required Iloaders
• Provide the root ILoader that will load assemblies, and satisfy dependencies
• Call the main entry point of the provided program
Layer 2
Managed Entry point
• Walks the dependencies in the project and builds up the closure of dependencies
• Adds ILoader => LoaderContainer that can load assemblies from various sources
• Calls the entry point of assembly name given as the next argument given to KLR.exe
Layer 3
Application Host
• Developer’s application code when running on the application host
Layer 4
Application
K Runtime Layering
K tools
- KVM (K runtime version manager)
- Switch between versions
- Switch between .NET runtimes
- Upgrade K Runtime
K tools
- KPM (K runtime package manager)
- Downloads or restores packages for application
- Runs from command-line
- Uses project file to detect required packages
kpm list
kpm use
kpm upgrade
kpm pack (-- runtime)
Roslyn
- (.NET) Compiler as a Platform
- Mission?
- Opportunities for:
- meta-programming
- code generation and transformation
- interactive use of the C# and VB languages
Roslyn
Roslyn
- API and Pipeline
Roslyn
- WebForms, MVC5, WebAPI 2, WebPages 3, SignalR
2, EF 6
- fully supported by Roslyn
Roslyn
Tools
- Nuget Package Explorer
https://npe.codeplex.com/
- Process Explorer
- API Portability Analyzer – Alpha
http://www.microsoft.com/en-us/download/details.aspx?id=42678
- MyGet
https://www.myget.org/
- Sublime editor
http://www.sublimetext.com/
More..
- .NET Native
- .NET Native compiles C# to native machine code
that performs like C++
- Popular Windows Store apps start up to 60%
faster and use 15-20% less memory when
compiled with .NET Native.
- C++ updates
- Command line scaffolding
- RyuJIT: The next-generation JIT compiler for .NET
Future of the core
- Why not nugget/MSBuild?
- Gulp
- Grunt
- Bower
Future of the front end build process
Known issues:
- Browser link
Fix: Disable Browser Link
http://blogs.msdn.com/b/webdev/archive/2013/06/28/browser-link-
feature-in-visual-studio-preview-2013.aspx
- Missing ASP.NET Loader IIS assembly
Fix?
- Opening project.json as a project
may lead to the wrong output type
Fix: Change output type
Known issues:
- After creating new vNext project, empty project
folder is created under the solution folder
- New project not under “src”
- KVM installation
WARNING!
- This shows what the ASP.NET team is working on
- DO NOT use it in Production
- DO NOT run it on your development machine
Links
- WebDev blog: http://blogs.msdn.com/b/webdev
- Asp.net: www.asp.net/vnext
- Asp.net Github: https://github.com/aspnet
- Scott’s blog: http://www.hanselman.com/
http://www.meetup.com/NET-User-Group-Novi-Sad/
O autoru…
- Mail: s.poznic@vegait.rs
- twitter: @srdjanpoznic
- Linked in: http://goo.gl/bXA7Av
T H A N K Y O U

The next step from Microsoft - Vnext (Srdjan Poznic)

  • 1.
    PARTNERSHIP The next stepfrom Microsoft - vNext October, 2014 Srdjan Poznic
  • 2.
    History of ASP.NET -Released in 2002 with VisualStudio.NET - ASP.NET Ajax (2007) - ASP.NET Dynamic Data (2008) - ASP.NET MVC added (2009) - WebAPI added (2012) - OWIN and SignalR introduced (2013)
  • 3.
    Current state ofASP.NET - MVC - WebAPI - WebPages, WebForms - Entity Framework Mature enough?
  • 4.
    Idea? - What wecan do to make .NET better on the cloud? - What we can do to make .NET better on the hosted environment? - How to improve development cycle? - …
  • 5.
    What customers say? -We want open-source! - We need to deliver much faster - We need cross-device development strategy - My customer can’t update to new version of framework. - …
  • 6.
    ASP.NET vNext - Latest:ASP.NET vNext alpha4 (October, 6th) - Visual Studio 14 CTP 4 (Community Technology Preview) - .NET Framework v4.5.3
  • 7.
    New approach - .NETInnovation Innovation on the core of existing and future applications - Flexibility and agile delivery Continuous modular releases - Openness Transparent, open and community driven
  • 8.
    Goal - Fast - Open-source -Modular - Cross-platform support - Choose editors/tools - Faster development cycle New builds and inside the tools (Use pieces that you what to use)
  • 9.
    What is new? -All about NuGet - New run-time engine called „K“ - Roslyn compiler - New project system - New configuration system - Cloud optimized .NET (CoreCLR) takes ~11MB
  • 10.
  • 11.
    New features - Side-by-sidedeployment - Exact same code is running on both machines - no GAC - Open source - Cross-platform (Windows, Mac, Linux)
  • 12.
    What is newin asp.net? - MVC, WebAPI, WebPages 6, SignalR 3, EF 7 - MVC, Web API & Web Pages have been merged into one - Cloud-optimized versions of MVC, WebAPI, Web Pages, SignalR, and EF - Host agnostic – runs not only under IIS
  • 13.
    What is newin asp.net? - Removing System.Web - Moving to OWIN middleware - e.g. Error screen replacement - HttpContext (minimum info in object graph) - The result is a leaner framework, with faster startup time and lower memory consumption.
  • 14.
    What is newin asp.net? - No Web.Config anymore - No Global.asax - No packages.xml file - No DLLs anymore AspNet.Loader.dll
  • 15.
    Runtime performances - OldHttpContext removed (~30K) - New HttpContext (~2K) - GC - Faster startup time - Lower memory - REST vs Line Business Apps (historical reasons)
  • 16.
    Faster development - Changethe file > Save > Refresh the browser - Faster development (dynamic compiling) - Cloud optimized - Develop in cloud editors
  • 17.
    Cloud - Seamless transitionto cloud (Same code is running) - Configuration - Session (SessionState to SessionStateProvider)
  • 18.
    Cloud - Cache Azure RedisCache / Asp.net cache - Run/Debug in Cloud Visual Studio Online “Monaco” - Tracing/Logging without re-deploy
  • 19.
    Extending application types -Knockout - AngularJS - Ember - Backbone - …
  • 20.
    Common improvements - DIeverywhere - Tracing and Diagnostics - Consistency
  • 21.
  • 22.
    To me, asa developer, this means - I get all the advantages of the .NET platform (performance, stability, security, comprehensive API) - The development experience of C# and Visual Studio... with the simplicity, portability, quick development refresh cycle and flexibility of an interpreted web framework.
  • 23.
  • 24.
  • 25.
  • 26.
    • Find andcall the CLR Native host • Pass in arguments given to the process to the native host Layer 0 Native processs • Boot the CLR • Calling the Managed Entry Point, Layer 2 Layer 1 CLR Native Host • Create the LoaderContainer that will contain the required Iloaders • Provide the root ILoader that will load assemblies, and satisfy dependencies • Call the main entry point of the provided program Layer 2 Managed Entry point • Walks the dependencies in the project and builds up the closure of dependencies • Adds ILoader => LoaderContainer that can load assemblies from various sources • Calls the entry point of assembly name given as the next argument given to KLR.exe Layer 3 Application Host • Developer’s application code when running on the application host Layer 4 Application K Runtime Layering
  • 27.
    K tools - KVM(K runtime version manager) - Switch between versions - Switch between .NET runtimes - Upgrade K Runtime
  • 28.
    K tools - KPM(K runtime package manager) - Downloads or restores packages for application - Runs from command-line - Uses project file to detect required packages kpm list kpm use kpm upgrade kpm pack (-- runtime)
  • 29.
    Roslyn - (.NET) Compileras a Platform - Mission? - Opportunities for: - meta-programming - code generation and transformation - interactive use of the C# and VB languages
  • 30.
  • 31.
  • 32.
    - API andPipeline Roslyn
  • 33.
    - WebForms, MVC5,WebAPI 2, WebPages 3, SignalR 2, EF 6 - fully supported by Roslyn Roslyn
  • 34.
    Tools - Nuget PackageExplorer https://npe.codeplex.com/ - Process Explorer - API Portability Analyzer – Alpha http://www.microsoft.com/en-us/download/details.aspx?id=42678 - MyGet https://www.myget.org/ - Sublime editor http://www.sublimetext.com/
  • 35.
    More.. - .NET Native -.NET Native compiles C# to native machine code that performs like C++ - Popular Windows Store apps start up to 60% faster and use 15-20% less memory when compiled with .NET Native. - C++ updates - Command line scaffolding
  • 36.
    - RyuJIT: Thenext-generation JIT compiler for .NET Future of the core
  • 37.
    - Why notnugget/MSBuild? - Gulp - Grunt - Bower Future of the front end build process
  • 38.
    Known issues: - Browserlink Fix: Disable Browser Link http://blogs.msdn.com/b/webdev/archive/2013/06/28/browser-link- feature-in-visual-studio-preview-2013.aspx - Missing ASP.NET Loader IIS assembly Fix? - Opening project.json as a project may lead to the wrong output type Fix: Change output type
  • 39.
    Known issues: - Aftercreating new vNext project, empty project folder is created under the solution folder - New project not under “src” - KVM installation
  • 40.
    WARNING! - This showswhat the ASP.NET team is working on - DO NOT use it in Production - DO NOT run it on your development machine
  • 41.
    Links - WebDev blog:http://blogs.msdn.com/b/webdev - Asp.net: www.asp.net/vnext - Asp.net Github: https://github.com/aspnet - Scott’s blog: http://www.hanselman.com/
  • 42.
  • 43.
    O autoru… - Mail:s.poznic@vegait.rs - twitter: @srdjanpoznic - Linked in: http://goo.gl/bXA7Av
  • 44.
    T H AN K Y O U

Editor's Notes

  • #3 History: http://en.wikipedia.org/wiki/ASP.NET
  • #7 Site: asp.net/vnext http://blogs.msdn.com/b/webdev/archive/2014/10/06/asp-net-vnext-in-visual-studio-14-ctp-4.aspx There are a few notable breaking changes in this release from Visual Studio “14” CTP3: - Project.json now uses "aspnet50" and "aspnetcore50" as framework values, instead of "net45" and "k10". - Project.json has a new “webroot” element to indicate the static content folder and an “exclude” element for folders to be excluded from compilation. - The Startup.cs IBuilder parameter was renamed to IApplicationBuilder.
  • #12 vNext will support true side-by-side deployment. If your app uses the cloud-optimized subset of .NET vNext, you can bin deploy all of your dependencies, including the .NET vNext (cloud optimized) packages. That means you can update your app without affecting other applications on the same server.
  • #13 vNext is host agnostic. You can host your app in IIS, or self-host in a custom process. (Web API 2 and SignalR 2 already support self-hosting; vNext brings this same capability to MVC.)
  • #22 ContainerMiddleware IServiceProvider
  • #24 Dependency Injection
  • #30 Roslyn Increasingly we rely on integrated development environment (IDE) features such as IntelliSense, refactoring, intelligent rename, “Find all references,” and “Go to definition” to increase our productivity. We rely on code analysis tools to improve our code quality and code generators to aid in application construction. As these tools get smarter, they need access to more and more of the deep code knowledge that only compilers possess. This is the core mission of the .NET Compiler Platform (“Roslyn”): The transition to compilers as a platform dramatically lowers the barrier to entry for creating code focused tools and applications. It creates many opportunities for innovation in areas such as meta-programming, code generation and transformation, interactive use of the C# and VB languages, embedding of C# and VB in domain specific languages.  Tools: Syntax Visualizer Syntax Quoter Enhanced source view
  • #33 First the parse phase, where source is tokenized and parsed into syntax that follows the language grammar. Second the declaration phase, where declarations from source and imported metadata are analyzed to form named symbols. Next the bind phase, where identifiers in the code are matched to symbols. Finally, the emit phase, where all the information built up by the compiler is emitted as an assembly. http://roslyn.codeplex.com/wikipage?title=Overview&referringTitle=Documentation
  • #35 http://blog.jonathanchannon.com/2014/08/05/nancy-aspnetvnext-osx-sublime-text/
  • #37 http://blogs.msdn.com/b/dotnet/archive/2013/09/30/ryujit-the-next-generation-jit-compiler.aspx
  • #38 Scott’s blog: http://www.hanselman.com/blog/CategoryView.aspx?category=ASP.NET
  • #40 - When you create an ASP.NET vNext project, an empty project folder is created under the solution folder. This folder should be removed because the real project folder is created in the <solutionFolder>\src subfolder. - In an ASP.NET vNext project, when you right-click the solution "src" folder and then you add a new project to it, the Add New Project dialog box uses the solution folder as the location instead of the "src" folder. - In Windows 8 RTM, the act of pressing F5 in an ASP.NET vNext project does not work for core CLR framework. However, Ctrl+F5 works correctly. The act of pressing F5 works correctly for core CLR framework in Windows 8.1. KVM installation: Run the following command from a command-line prompt to install the K Version Manager. @powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/master/kvminstall.ps1'))"
  • #42 http://msdn.microsoft.com/en-us/vstudio/dotnetnative.aspx https://github.com/aspnet http://roslyn.codeplex.com/ http://blogs.msdn.com/b/webdev/archive/2014/05/12/enabling-the-net-compiler-platform-roslyn-in-asp-net-applications.aspx http://blogs.msdn.com/b/webdev/archive/2014/06/03/asp-net-vnext-in-visual-studio-14-ctp.aspx http://blogs.msdn.com/b/webdev/archive/2014/08/12/develop-asp-net-vnext-applications-on-a-mac.aspx http://blogs.msdn.com/b/webdev/archive/2014/06/17/dependency-injection-in-asp-net-vnext.aspx