The new version of the .NET Framework called vNext brings a lots of news, which are believed to be able to return to the popularity of Microsoft tools and products.
Principles that guided the development team when developing new versions of frameworks are:
• Speed, Runtime performance,
• Modularity,
• Cross-Platform,
• Open-source,
• Faster development cycle,
• Custom code editors and tools.
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 of ASP.NET
- MVC
- WebAPI
- WebPages, WebForms
- Entity Framework
Mature enough?
4. 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?
- …
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
- .NET Innovation
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
11. New features
- Side-by-side deployment
- Exact same code is running on both machines
- no GAC
- Open source
- Cross-platform (Windows, Mac, Linux)
12. 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
13. 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.
14. What is new in asp.net?
- No Web.Config anymore
- No Global.asax
- No packages.xml file
- No DLLs anymore
AspNet.Loader.dll
15. Runtime performances
- Old HttpContext removed (~30K)
- New HttpContext (~2K)
- GC
- Faster startup time
- Lower memory
- REST vs Line Business Apps (historical reasons)
16. Faster development
- Change the file > Save > Refresh the browser
- Faster development (dynamic compiling)
- Cloud optimized
- Develop in cloud editors
17. Cloud
- Seamless transition to cloud
(Same code is running)
- Configuration
- Session
(SessionState to SessionStateProvider)
18. Cloud
- Cache
Azure Redis Cache / Asp.net cache
- Run/Debug in Cloud
Visual Studio Online “Monaco”
- Tracing/Logging without re-deploy
22. 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.
26. • 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
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) Compiler as a Platform
- Mission?
- Opportunities for:
- meta-programming
- code generation and transformation
- interactive use of the C# and VB languages
33. - WebForms, MVC5, WebAPI 2, WebPages 3, SignalR
2, EF 6
- fully supported by Roslyn
Roslyn
34. 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/
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: The next-generation JIT compiler for .NET
Future of the core
37. - Why not nugget/MSBuild?
- Gulp
- Grunt
- Bower
Future of the front end build process
38. 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
39. Known issues:
- After creating new vNext project, empty project
folder is created under the solution folder
- New project not under “src”
- KVM installation
40. 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
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.
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.
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.)
ContainerMiddleware
IServiceProvider
Dependency Injection
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
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
- 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'))"