In this video, learn how to configure your 1.1 application for view compilation on publishing.
- [Instructor] Another new feature in 1.1…is the ability to precompile your views.…Now, this requires the…Microsoft.AspNetCore.Mvc.Razor.ViewCompilation package,…and then you have to update the project file,…adding in the tag you see here on your screen,…MvcRazorCompileOnPublish, and set that value to true.…There's two considerations.…Of course, since they're precompiled,…the resulting publication bundle is smaller.…
But since the views are not shipped in that bundle,…they cannot be edited after precompilation.…Updated in 2.0 is that views are precompiled by default.…So let's look at how this works.…To get into the csproj file,…you can right-click on the project,…say Edit the SpyStore version 11 csproj.…I already have it open.…Here on line eight is the tag that I had to add in,…and I set it to true.…
And then I simply did a publish,…and I just did a publish to folder,…and let's look at the results of that publish.…So not precompiled, we have a…size on disk of 33.3.…And the precompiled version, we have a size on disk of 20.4,…
- Running and debugging ASP.NET Core applications
- Pros and cons of migrating existing applications to ASP.NET Core.
- Built-in dependency injection
- Environment awareness and app configuration
- Web host configuration and SSL
- View components invoked as tag helpers
- Configuration and logging
- Using Razor Pages
- Web API improvements
- Support for creating GDPR-compliant applications
Skill Level Intermediate
Use the exercise files3m 37s
1. Get to Know .NET Core
2. ASP.NET Core 1.0
3. ASP.NET Core 1.1
4. ASP.NET Core 2.0
5. ASP.NET Core 2.1
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.