After updating to Visual Studio 2018 Update 15.8 I noticed a new menu option in Visual Studio under Build –> ASP.NET Compilation –> Optimize Build Performance for Solution:
What does it do?
ASP.NET projects carry a copy of the compiler to be able to compile views at runtime. However, on a developer machine when the copy of the compiler doesn’t match Visual Studio’s copy, your build performance is impacted on the order of 1-3 seconds per incremental build. Enabling this feature will update your project’s copy of the compiler to match Visual Studio’s which should speed up your incremental builds.
When you select the menu option, you’ll get a screen that allows you to select all projects where to apply this change:
After you click OK, Visual Studio will replace the Microsoft.Net.Compilers package with a newer Microsoft.CodeDom.Providers.DotNetCompilerPlatform package:
Remark: This is applicable to ASP.NET Framework projects only, it does not apply to ASP.NET Core.