Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do dynamically compiled files use csc.exe in .NET?

Title asked it all,

Do dynamically compiled files, such as .cshtml files, use csc.exe in .NET?

I saw this question C# JIT compiling and .NET

But it doesn't fully go into the compilation of a dynamic file to before being Jit'ed.

So you have this site https://msdn.microsoft.com/en-us/library/ms366723.aspx. Which says:

By default, ASP.NET Web pages and code files are compiled dynamically when users first request a resource, such as an ASP.NET page (.aspx file), from a Web site. After pages and code files have been compiled the first time, the compiled resources are cached, so that subsequent requests to the same page are extremely efficient.

So am I to understand that csc.exe runs on first request of a new resource before being JIT'ed?

like image 624
Adam Avatar asked Nov 09 '22 14:11

Adam


1 Answers

The short answer appears to be yes.

  • Source: https://blogs.msdn.microsoft.com/webdev/2014/05/12/enabling-the-net-compiler-platform-roslyn-in-asp-net-applications/

"the Roslyn compiler would be loaded into memory, improving greatly performance for not pre-compiled websites with multiple .asx/*.cshtml files. The new version, however, features a new /bin/roslyn/csc.exe file, which is executed once per file, completely removing the mentioned above optimization feature"

like image 78
Shahed C - MSFT Avatar answered Nov 28 '22 23:11

Shahed C - MSFT