This question is related to How to speed up aspnet_compiler.exe?
The answer mentions using Roslyn instead and provides the link to this post - https://devblogs.microsoft.com/dotnet/enabling-the-net-compiler-platform-roslyn-in-asp-net-applications/
But this post does not explain anything, except instructing to reference a certain NuGet package, which simply copies roslyn binaries to _PublishedWebsites\<TheWebAppName>\bin\roslyn
. Now maybe this is all it takes to switch to roslyn at runtime after that folder is deployed. I do not know. What I do know is that our build calls the AspNetCompiler
task to compile the Mvc views to make sure they are OK before we deploy them. We may even precompile them to include with the deployment package to avoid runtime compilation at all.
Anyway, it is unclear and I could not find it anywhere - how do we use Roslyn instead of aspnet_compiler.exe during the build?