ASP.NET: Roslyn slow on page changes

后端 未结 2 1379
南方客
南方客 2021-02-20 04:53

i have an VB.NET ASP.NET (4.6.1) MVC Application which is build with the new Roslyn Compilers.

Everytime i change a (vbhtml) File and reload the page it takes approx 9 s

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-20 05:38

    The new compiler takes several seconds to start since it needs to JIT many IL assemblies. Ngen'ing the compiler and its dependency assemblies would help reduce the starting time. What you can do is to find the compiler assembly and do

    ngen.exe install VBCSCompiler.exe
    ngen.exe install csc.exe
    ngen.exe install vbc.exe
    

    You would need to run the above commands from an elevated console. And you may need to use the 64-bit ngen.exe if your machine is 64-bit. Normally the 64-bit ngen.exe locates in C:\Windows\Microsoft.NET\Framework64\v4.0.30319.

提交回复
热议问题