To support C # 6 in our Razor views on MVC5, we have included the Roslyn compiler platform through web.config:
<system.codedom> <compilers> <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" /> </compilers> </system.codedom>
However, after production deployments, each view / controller has a noticeable “First boot” delay, which is worse than without turning on this compiler.
It is important to note that this delay is in addition to the regular JIT delay that you receive from the new deployed site. Pages are noticeably slower, and VBCSCompiler.exe runs in the background to "further compile" these pages.
Is there a best practice for pre-compiling / optimizing this situation to avoid delayed mail deployment on first boot? Ideally, VBCSCompiler.exe does not start after deployment and runs at build time.
I saw mentions of aspnet_compiler.exe and ran into StackExchange.Precompilation (see https://blog.stackoverflow.com/2015/07/announcing-stackexchange-precompilation/ ) and wonder if this fix is correct.
Does anyone have any experience with this particular problem? Thanks.
source share