1

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?

mark
  • 59,016
  • 79
  • 296
  • 580
  • As I understand you are targeting .NetFramework runtime? From my understanding Roslyn is used when using dotnet cli. This is related to .NetCore. If you could target .NetStandard you could give dotnet cli a try. You can use the Roslyn nuget to compile code at runtime. This I would highly disencourage from what I understand concerning your needs. – Clemens Dec 23 '21 at 10:48

0 Answers0