DNX Arrives With ASP.NET 5 Beta7 |
Written by Kay Ewbank | |||
Wednesday, 09 September 2015 | |||
The latest beta of ASP.NET 5, recently released by Microsoft, includes the first public preview of the .NET Execution Environment (DNX) for Mac and Linux based on .NET Core. The inclusion of DNX based on .NET core means there’s no longer any need to use Mono, although the Mac and Linux support is still described as ‘limited’. The .NET Execution Environment (DNX) provides a consistent way to build and run cross-platform .NET projects and is the basis for ASP.NET 5. DNX has been improved in other ways; you can see which package sources were used after doing a `dnu restore`, and the error messages when you have incompatible package dependencies have been improved. You can also specify which .NET Framework version to run using a new --framework switch. Testing has been improved in this beta with the inclusion of new unit testing templates, and you can also generate a unit testing project from the command-line using the Yeoman ASP.NET generators. Support has also been added for discovering async tests for DNX projects. Kestrel (the web server for ASP.NET vNext based on libuv) now supports writing chunked responses automatically when no content length is specified for the response. It also now uses write-behind buffering so responses are written more efficiently to the network. MVC/Razor is another area that’s been improved. Razor comment blocks no longer introduce unnecessary whitespace. When you have comment blocks, Razor now removes the whitespace when the entire line consists of a Razor block, so your rendered views look cleaner and consume less bandwidth. There’s also a new ViewComponentResult in MVC that you can use to return the result of a ViewComponent from an action. This means you can expose the logic of a ViewComponent as a standalone endpoint. One useful change is to the way MVC handles URLs containing a ~. Until now, referring to the web root of the application in this way was handled directly in Razor, resulting in problems if you had other occurrences of ~ in your views as Razor would assume you were attempting to refer to the application web root. Support for ~ has now been moved out of Razor into a new UrlResolutionTagHelper, which restricts handling of ~ to only src and href attributes of well-known HTML elements. Tag helpers have been improved so you can specify which elements are parents and which are children, and how they should work together using RestrictChildrenAttribute. So if you have multiple tag helpers that work together, where one is the parent of another such as a row in a grid, you can declare that the tag helper expects only certain child elements. If other elements are found, you’ll get an error from the parser. Support has also been added for elements without end tags, so that the tag helper should apply to an element even when it has no end tag. Support for conditional attributes has also been added to tag helpers. Tooling is another area that has been improved. You now have the option in DNX based projects to refactor the class name when the file name for the class is changed; and the debug logger is included in ASP.NET 5 project templates. You also now get tool tips for tag helpers in the HTML editor. More InformationAnnouncing Availability of ASP.NET 5 Beta7 Related ArticlesASP.NET 5 Cross Platform - But Is It Still ASP? Microsoft's Project Helios - The New ASP.NET
Comments
or email your comment to: comments@i-programmer.info |
|||
Last Updated ( Wednesday, 09 September 2015 ) |