The guys talk to ASP.NET team member Damian Edwards about ASP.NET vNext (the next version of ASP.NET), Tag Helpers, and what’s new with SignalR.
Download / Listen: Herding Code 198: Damian Edwards on ASP.NET vNext, Tag Helpers and SignalR
Show Notes:
- Hello. What is ASP.NET vNext?
- (00:18) ASP.NET vNext is the next version of ASP.NET. It’s not just ASP.NET MVC 6 or Web API 3, it’s a total rethink of the ASP.NET platform. In some ways, it’s a bigger change than the move from classic ASP to ASP.NET. In other ways, it can be pretty seamless depending on what you’re doing.
- (01:29) Jon asks Damian to talk about what’s crazy and brand new. Damian describes the full stack in a web application, from the operating system up to the code that you write in your application and the libraries you bring in. Starting at the bottom of the stack, ASP.NET vNext is cross platform, meaning it will work and be supported on Linux and Mac.
- Cross platform
- (02:36) Jon asks Damian to clarify what that means – is it supported cross-platform, or does it just kind of work? Damian says that it’s first class support – they’ll ensure that it works cross-platform, there will be cross-platform documentation, and there will be cross-platform tooling (Damian mentions the Sublime plugin for ASP.NET vNext). They’ll support building and deploying ASP.NET vNext applications cross-platform.
- Core CLR
- (03:41) Damian continues up the stack, talking about how .NET framework is booted up. In vNext, there is a native code custom CLR loader that is decoupled form the operating system’s .NET loader. Even when you’re running on Windows, you’re not relying on the standard .NET loading mechanism.
- (05:56) Jon mentions having seen demos where code was written on one laptop, copied onto a USB drive, and executed on another laptop, asking if the custom .NET loader is what makes that work. Damian explains that’s half of why it works – the next layer of the platform is the managed runtime itself, which is the other half of the magic. There is a new CLR based on core CLR. Damian explains how the .NET runtime runs on a core CLR and the base class libraries. The core CLR is based on the .NET CLR for Silverlight – it was already a lightweight version that ran cross-platform. There are now two options for the CLR you can run on – the full .NET CLR, or the new "cloud optimized" CLR. It’s important because it’s smaller – so small that it can be deployed with your application. Also, because it can be self-contained, multiple versions can run on the same server.
- (10:01) Scott K asks what prevents bundling the entire application up into a single EXE. Damian talks about how .NET Native is being used in Windows Store applications and says they’re intending to look at that for ASP.NET vNext in the future. For now they’re achieving isolation by shipping the core CLR and libraries as NuGet dependencies.
- (12:30) Scott K asks if you need to have the .NET framework installed at all if you’re running ASP.NET vNext. Damian says no, and if .NET is installed it has no bearing on your application.
- (12:12) Jon asks how this affects IT shops that want full control over .NET framework installations on their servers. Damian says this question requires more context on what administrators would be afraid of. He describes how ASP.NET vNext will support servicing, so any urgent vulnerabilities can be patched globally on a server.
- How does this affect existing apps? What changes?
- (14:50) K Scott brings up a Twitter question from James on how this will affect ASP.NET MVC and Web API applications. Damian says that ASP.NET MVC 6 will include both ASP.NET MVC and Web API. Damian explains how ASP.NET MVC is on version 5 and there are some things they’d do differently today. It also previously depended on System.Web, which dates all the way back to before 2000. ASP.NET MVC 6 has DI built in. It’s OWIN compatible, so you can run it on any OWIN compatible server and run any OWIN middleware. Global configuration (web.config and System.Configuration) are gone, replaced by code-based configuration influenced by Katana. There’s also Entity Framework 7, which is a complete rewrite that doesn’t have ObjectContext or System.Entity – instead it makes model first (DbContext) foundational. EF7 also works with non-relational databases. If you have an existing application with ASP.NET MVC 5 or Web API 2, it should port over pretty seamlessly as long as you’re not working directly with underlying components like System.Web or HttpContext.
- Development experience
- (19:39) Scott K asks about the development experience – will this work in a new Visual Studio version, or can he just create applications in a text editor? Damian says both will work. This both allows cross-platform development and a more flexible development stack, allowing for things like cloud-based development. Of course, ASP.NET will work work great on Visual Studio. They use Roslyn to do all the code compilation either at design or compile time. This allows for deploying the entire application as source, and eliminates the need for a separate compile step during development (since the code is constantly being compiled as you work).
- (25:15) K Scott asks how much churn he should expect if he starts developing with ASP.NET vNext today. Damian says there’s a lot of churn still right now. It won’t release until well into next year some time.
- Questions from Twitter
- (26:34) Iris Classon asks what features they weren’t able to include that they’d have liked to. Damian says it’s too early to answer that question, since they’re still in pretty early development.
- (27:00) Iris Classon also asks where they looked for inspiration. Damian mentions web frameworks like Rails and Node as well as module loading in Java.
- (27:38) Ben Maddox asks how Damian sees this improving the feedback loop for code, UI and tests. Damian says it speeds up UI feedback since all of your code is compiled as you type it and continuous testing is enabled due to the continuous compile. Both are available today with other tools or things you set up yourself, but it will be simpler in future.
- (28:55) Steen R. asks when we’ll see cross-platform Visual Studio. Damian says there are no plans he’s privy to.
- (29:05) Filip Woj. asks if F# will have first class support – released and supported. Damian says not for version one, although there are demonstrations of F# providers.
- (30:40) Steen R. asks how webroot will work in practice. Damian describes how webroot works – it’s a separate directory from which your application is served. Any files not in the webroot folder will not be served by the web server. Your application or uploads folders will be separate from your webroot, so they can’t be served.
- Portable areas?
- (33:49) K Scott asks about portable areas. Damian says he’s not aware of something like that for ASP.NET MVC.
- Tag Helpers
- (35:18) Jon asks what tag helpers are. Damian describes how Razor is a templating language that’s designed to allow mixing C# and HTML. It falls down a bit when you’re using HTML Helpers and want to change the output – for instance, if you want to pass in an HTML class to an element. C# gets in the way due to things like class being a reserved word, and you miss out on any HTML IntelliSense or HTML editor smarts, because you’re just working with C# strings. Tag helpers allow you to just write HTML tags with attributes that Razor understands. These can do things like access the model metadata to emit appropriate form HTML.
- (41:27) K Scott asks when he can start using it. Damian says that it’s in a separate feature branch now and explains how to use them and says you can ping Taylor Mullen for help – or just wait a few weeks and it’ll be in the main branch.
- (42:59) Jon comments on how the Spark view engine provided something similar, and Damian says that Lou works right next to him and has helped with the design. They’re not trying to change the core of how Razor works or feels, just make it easier to work with HTML helpers.
- SignalR
- (44:10) Jon asks what’s new with SignalR. Damian runs down some of the recent releases and mentions SignalR 3 for ASP.NET vNext. He also mentions the C++ client that’s currently in development.
- (45:28) Jon asks if ASP.NET vNext makes some things simpler for SignalR. Damian says the main impact is that things like configuration and tracing are now shared between components like Web API and MVC.
- Wrap Up
- (46:56) Jon asks Damian what’s coming up for him. Damian mentions some of the talks he’ll be doing at NDC London, including load testing SignalR and ASP.NET vNext.
- (47:50) Jon asks Damian how people can keep up with ASP.NET vNext, mentioning the asp.net/vnext page. Damian also recommends the weekly ASP.NET vNext Community Standup meetings, being run as a public weekly Google Hangout hosted by Scott Hanselman and Jon Galloway.
Show Links: