Update – 11-30-2015: The ASP.NET 5 RC1 installers and DNX packages have been updated to address the following issues:
- If you run the Windows installer from a folder that contains previous versions of the MSI installers for DNVM (DotNetVersionManager-x64.msi or DotNetVersionManager-x86.msi) or the ASP.NET tools for Visual Studio (WebToolsExtensionsVS14.msi or WebToolsExtensionsVWD14.msi), the installer will fail with an error “0x80091007 – The hash value is not correct”.
- When installing on OS X the .pkg installer would create the ~/.dnx folder on a clean machine as root so you couldn’t do anything involving that folder unless you were root (aspnet/dnx#3191)
- Running a published .NET Core based application results in FileNotFoundExceptions for missing assemblies (ex. System.Net.Security, System.Data.SqlClient) (aspnet/dnx#3183)
As scheduled on our ASP.NET 5 roadmap and demonstrated during the Connect() event, we are proud to announce the availability of runtime and tooling for the RC1 release of ASP.NET 5. The framework and enhanced web development tools are available with Visual Studio 2015 Update 1, or you can install the framework and tools from the new http://get.asp.net site. There are instructions, downloads, and samples there for you to learn more about the new ASP.NET 5. The complete release notes for this RC version are also available online.
Unlike the beta releases of ASP.NET 5, this release candidate does not have significant new framework features but does have a number of programming model changes that you should be aware of if you are migrating from a beta version of ASP.NET 5. In this post, we’ll review some of the new Visual Studio features and highlight some of the important framework changes.
Visual Studio Updates
Get Started with ASP.NET 5 RC
When you initially download and install the Visual Studio 2015 Update 1, you will not immediately have the ASP.NET 5 RC tools installed and available. When you start a new Web Project you will be presented with the ‘New ASP.NET Project’ window to choose a web application template, and among the templates is a ‘Get ASP.NET 5 RC’ template. When you choose that template, we will install the RC version of ASP.NET 5 tools and frameworks.
The familiar three ASP.NET 5 templates Empty, Web API, and Web Application are then available after the installation completes.
To help direct developers towards building web applications with responsive interfaces that work on any device, we are introducing bootstrap snippets as a recommended extension when you start editing HTML or CSHTML pages in an ASP.NET 5 project. You will receive a suggestion at the top of the Visual Studio editor that indicates recommended extensions are available. Once accepted, a window appears that will show you the recommended extensions.
This extension installation needs to be completed only once per Visual Studio install and does not need to be repeated for every project. The result is a collection of almost 40 HTML snippets that will be added to the Visual Studio toolbox for HTML and CSHTML pages to help create widgets and layouts using the bootstrap CSS framework.
New Bower Package Manager UI
The user interface presented is similar to the new NuGet package manager, however it is populated with Bower packages and searches Bower endpoints.
Not all of the information provided by the NuGet package details is available in Bower package data, but we will do our best to populate as much information about the Bower package as possible on the right panel. When you install / update / uninstall a package, an appropriate entry for that package and version will be written into the bower.json file and Visual Studio will perform that task.
Incompatible NuGet Packages
In an effort to help with Bower adoption, we have introduced a new feature in the NuGet package manager user interface to show Bower recommendations. For popular packages we have identified that have client-side contents, this feature will recommend you use Bower in ASP.NET 5 projects and provide a link to the matching Bower package.
With this release, we are updating MVC Scaffolding to work with ASP.NET 5. Initially only available in projects that have authentication configured, you can again right-click on a folder in your project and choose to ‘Add -> New Scaffolded Item’ to your project.
The familiar configuration windows from previous versions of ASP.NET will appear and allow you to define how you would like your MVC Controller, API Controller, or Razor Views configured.
Solution Explorer Cleanup
With the new interactions between ASP.NET, Gulp, Bower, and npm we knew that the Solution Explorer view was getting a bit crowded. To help simplify and lead developers to use tools in Visual Studio we moved some items around and hid others from view. Consider this initial view of a new project in Solution Explorer:
You will notice that the bower.json file is not present, and the Dependencies element is underneath the wwwroot element. With the new Bower package manager interface, we want to encourage using this more user-friendly technique to install packages. The package.json file used by npm is hidden by default as well. You can make these hidden files appear in the window by clicking the ‘Show all items’ button at the top with the toolbar icon that looks like a stack of cards. While these files are not visible, they are committed to source control.
We have removed the hosting.ini file and instead we are recommending that a hosting.json file be used in its place. The lack of this file in a project means that the default configuration of the host listening on port 5000 will be used.
The ViewModels that were in older versions of ASP.NET MVC Models folder have been placed into separate files and placed in appropriately named folders under the ViewModels folder in the default project configuration. This should help make it clearer what and where these objects come from while building an ASP.NET MVC application.
Framework and Runtime Updates
Static Void Main
In order to more closely align with the syntax of an application entry point in other versions of the CLR, a new web application entry point has been introduced in the familiar “static void main” syntax. Starting with this version of ASP.NET 5 templates, you will find a single line at the bottom of the Startup.cs file:
public static void Main(string args) => WebApplication.Run(args);
This directive mapping gives the dnx a clear entry point in your code to start the web application. Optionally, you could convert this into an explicit method body to perform any other tasks that you want your application to handle before the host starts and initializes the web application with the other methods in the Startup class. Another option with the Main method is that it can return an integer instead of void if you would like to be able to signal error codes from your application. For more details please see the announcement on GitHub.
Cross-platform SQL Client
With the RC, we are taking another large cross-platform step by introducing a beta version of a cross-platform capable SQL client library. In the default templates, you will find this library included indirectly by the EntityFramework.MicrosoftSqlServer package.
With this library, you can now have ASP.NET query SQL Servers from Windows, Mac, and Linux. The only limitation at this release currently is that you must disable multiple active recordsets in the connection string to access the SQL Server.
There is a known issue on some platforms where the System.Net.Security package is not properly loaded by DNX. If you encounter an error where this package is not located for the SqlClient, you can explicitly add the System.Net.Security package to your project.json configuration to work around this issue.
Default webroot folder
In the beta versions of ASP.NET 5, the base folder for the static content of an application was defined with the “webroot” configuration property in the project.json file. After reviewing how this configuration option was used and to provide a clearer definition of the content of the project.json file, it was decided to move the webroot configuration option to a hosting.json file that lives next to the project.json file. The ASP.NET 5 hosts will no longer honor this configuration parameter in project.json
However, the ASP.NET hosts are smart if you do not have a hosting.json file with a webroot parameter configured. If there is a wwwroot folder in the base application folder, it will default that as the webroot of your application. If there is not a wwwroot folder, it will serve the base application folder as the base of static file contents for your web application.
Strong Named Framework Libraries
We are now adding strong names to the framework libraries that are referenced by ASP.NET. The complete list of libraries effected are listed on the GitHub strong-naming announcement. This change helps us on several fronts:
- There are other projects that need to take a dependency on ASP.NET and require strong naming, and their dependencies must be strong-named.
- In order to help with applying patches on Windows operating systems using Windows Update, we need to place these libraries in the GAC. In order for these libraries to reside in the GAC, they must be strong-named.
Introducing the .NET Platform Standard
There are several versions of .NET frameworks available, and the introduction of the .NET Core framework further introduces complications for portable class library authors. To simplify the targeting of .NET frameworks for developers, we are introducing the .NET Platform Standard. The short definition of the Platform Standard is that it is a single representation for binary compatible .NET Frameworks in packages and project.json instead of representing them as “portable-a+b+c”. For various versions of the framework, they can be grouped together as “dotnet5.4” with this version of the tools. This is a work in progress, with the naming convention for these frameworks changing to ‘netstandard1.x’ in a future release. More details on the plans for the .NET Platform standard roadmap are available on the .NET Roadmap.
NuGet and dnu both support this new representation of compatible .NET frameworks, and more details and tools will be made available as this new definition of .NET Framework compatibility evolves through our completion of the ASP.NET 5 RTM.
With this version of ASP.NET 5 templates, the “Class Library (package)” project template will target “dotnet5.4” which has binary compatibility with .NET 4.6, .NET Core 5, and Mono.
Other Breaking API Changes
There were a number of other API changes after we completed our API review of the entire framework. We have shared and documented these changes in the Announcements repository on GitHub. Use this handy query to review the complete list of changes to the framework in the beta8 – RC1 cycle.
Glimpse v2 Beta1 Released for ASP.NET 5
Glimpse v2 is a major evolution of the Glimpse platform for Web diagnostics and it is now available for ASP.NET 5. There’s lots of new bells and whistles, but the team highlights four key improvements in this early beta release: First, there’s a new and improved UI paradigm that puts diagnostics on the stage that they deserve. Next, because Glimpse v2 is based on ASP.NET 5 and the .NET Core, it’s cross platform and runs everywhere ASP.NET can run. Third, Glimpse now not only instruments the server as it has in the past, but it also leverages modern browser diagnostics API’s to provide a complete picture of the performance of a request end-to-end. Lastly, Glimpse now supports a wider range of production environments, including those with multiple web front ends. Be sure to check out the full details of the Glimpse announcement over at their blog.
Starting with the RC1, we are including a “Go Live” license. This license allows you to deploy an application written with ASP.NET 5 RC1 to a production environment and utilize Microsoft Support. The duration of this license for the RC1 last until the next release candidate or the completed release of ASP.NET 5 (called an RTM release) that is currently scheduled for Q1 2016. This license also covers running ASP.NET on Windows, Linux, and OSX.
Run on IIS
When you are ready to publish your ASP.NET 5 web application, you may want to run it on a Windows Server with IIS just as all previous ASP.NET applications were deployed. In the ASP.NET 5 model, you will need to configure IIS to use the HTTP Platform Handler with the ASP.NET host. Instructions describing how to configure IIS for use with the new ASP.NET hosting model are available on docs.asp.net.
Support for Azure
ASP.NET 5 was built to be cloud-ready, and we’ve made it easy to publish your new ASP.NET 5 applications to Azure and use CoreCLR libraries for Azure Active Directory, Storage and SQL Database. With this release we have also released Azure Management libraries for Azure Compute, Network, Storage, App Service, Resource Manager and more which target CoreCLR. To get started with these Preview libraries, click here.
You can also use the Visual Studio Publish feature to create a new Azure Web app and publish your application quickly and confidently to Azure. For more information about the Azure App Service and to get started for free, visit http://tryappservice.azure.com
The collection of tools, stabilization changes, and framework alignment changes in the RC1 of ASP.NET 5 should make development easier and prepare you for success with the upcoming .NET Platform Standard. With continued support for OSX and Linux environments in this release, the ASP.NET platform has matured and is now officially supported by Microsoft on all three major operating systems. Its an exciting time as we prepare to deliver this vision of a new ASP.NET. There are several ways that you can get involved:
- Follow our weekly community standup broadcast at live.asp.net for more information from the program managers leading the project. Ask your questions and listen in to the updates every Tuesday to learn more about the progress of the project.
- Get the latest ASP.NET tools, samples, and bit from get.asp.net.
- Read and contribute to our open sourced documentation at docs.asp.net Every article is markdown in Github that you can submit updates to. Get your name listed as an author of the ASP.NET 5 documentation by submitting an acceptable pull-request!
We have almost completed ASP.NET 5, and have some items to complete with regards to performance goals and the .NET Platform standard. What are you going to build with the new ASP.NET?