ASP.Net vNext – Codestock 2015


Here are my rough notes on the ASP.Net vNext session at CodeStock 2015.

The session was about what’s coming with .Net in the very near future.  In short, it’s going to be all open source, will be available by November 2015.  A demonstration was shown where the presenter created an ASP.Net web app with the Sublime source code editor on a Mac and ran it on a Mac — No Windows involved at all.  No Visual Studio.  The same should be true for Linux as well.

Here are my bullet points taken during the session:

Presenter:  Sam Basu @samidip from Telerik.

  • .Net is going open source.
  • .Net Core 5 – Rewritten from the ground up. Leaner and more modular (don’t need the parts you don’t use).
  • Cross platform (Mac, Windows, Linux, Raspberry pi)
  • .Net native to compile to real machine code.
    • More information here:
  • ASP.Net redesigned from the ground up to be leaner.
  • October/November 2015 expected release.
  • Can build Core CLR with just the components you need and deploy those with your app, like Mono.  In other words, you don’t have to rely on .Net being installed.  You deploye the parts your app uses WITH your app.
  • KRE – Runtime engine. = DNX
  • KVM – version manager = DNVM
  • KPM – package manager to download packages you need from NuGet = DNU (Dot Net Executable)
  • K – Command Line Tooling.
  • something? <– Taken off screen before I could capture it.
  • Nuget package manager was in the room (That’s a guy, not a product!). He said v5 will not install .js or other deployables. He said use “%$#@!” <– unaudible.
  • Sam showed an ASP.Net web app running natively on his Mac.
    • Visual Studio solution now has wwwroot folder for static content.
    • Now has a “Compiler” folder.
    • project.json replaces web.config
      • This is an interesting change.  Web.config has always been there as an XML file with project settings.  That’s now replaced with a similar file with a JSON format.
  • ActionResult is now IActionResult as the return type of ASP.Net MVC action methods.
  • Rosolyn allows you to change a C# file and run without compiling! Not working like this on Mac yet.
    • Example shown where Sam run an ASP.Net web app, changed a line of code in the C#, then hit refresh on the browser, and it displayed the results of the changed code.  He did NOT recompile the app.  This will be a big time saver.
  • New in ASP.Net MVC 6
    • Merger of MVC & Web API — they’re the same thing now.
    • View Components (don’t know what that means)
    • TagHelpers (old @Html.Helpers) mixed up C# and HTML which was kind is of confusing. You can now write custom tags that have no meaning to browser, but do to the server
      • Examples:
        • old = @Html.Label(“FirstName”, “First Name:”, new {@class=”caption”})
        • new = <label class=”caption” for=”FirstName”>first Name:</label>
          • handled server site.
  • (What’s New in ASP.NET Web Forms in .NET 4.6)
  • WPF will be a nuget package that ships with your app so you get that isolated with your app.

Use named objects instead of strings in your ASP.NET MVC apps

One of the frustrating things about ASP.NET MVC is the use of strings to represent objects that should be able to be referenced directly.  This way, the compiler could detect your typos and intellisense could offer valid, existing object names.

While this functionality doesn’t come out-of-the-box with Visual Studio, you can add it with T4MVC.

Here’s an example of what you do without T4MVC:

@Html.ActionLink("Delete User", "Delete", "Users", new { id = Model.UserID }, null)

Here’s how you do it with T4MVC:

@Html.ActionLink("Delete User", MVC.Users.Delete(Model.UserID))

Pretty much everywhere you’d use a string to reference a type, an object, a controller, or an action method, you can now use with actual, named types and objects.  The compiler, rather than your users, will detect your errors and intellisense will provide for you available items while writing code.