ASP.NET continues to compile

After deploying our ASP.NET applications (mainly with AJAX) on one specific production computer, the recompilation process (where w3wp.exe calls CSC.exe for each aspx or ascx file) continues for several hours. Thus, web application performance is very sloppy. When deployed to other production machines, these same applications complete compilation in minutes.

These aspx compilations are visible only in ProcExp for a second, and the parameter files used on the command line that are deleted immediately after compilation, so it’s very difficult for me to control which files are compiled, or see if the same file is compiled more than once. Is there a way to register the compilation process so that I can understand why this machine is not working properly?

I know that we can use aspnet_compiler.exe to precompile the entire application, but getting this during the build and deployment process (TFS 2010 plus OctopusDeploy) will be a little painful. In addition, my attempts to pre-compile manually in the command line do not work. The precompilation succeeds, but when IIS is specified in the destination directory, any request for any file throws this error:

Exception Type: HttpException

Exception message: the file '/default.aspx' has not been precompiled and cannot be requested.

ETA: this is what I want from this question

  • Is there something I should check to determine why this machine spends so much time compiling?
  • Is there something I can do to write files that compile when?
+5
source share
3 answers

We use precompilation as the only method to solve this problem, otherwise you will see several msbuild.exe processes. On the fly, compilation cannot produce the desired result. Using Visual Studio 2012 or later, it’s very easy to create a publishing profile and then transfer that profile to the original control so that you don’t have to do this again and again. Also you blame the build process for the poor performance of your application, I would suggest taking a look at how to optimize your application. As for us, we had little performance, then we switched to SessionPageStatePersister , which improved many performance issues. I would recommend the following awesome videos, just watch them and see how much you have already done and how much you can do.

Optimize the performance of your ASP.NET web application

Deep Dive: Improving Performance in Your ASP.NET Application

0
source

Dynamic compilation

Dynamic compilation

ASP.NET should save files in the cache after compilation and recompile only when something changes. Because MSDN says:

Any changes in the dynamically compiled file will automatically invalidate the file with the compiled assembly cache and the trigger will recompile all the affected resources

Most likely, in your case, dynamic compilation affects itself in such a way that it causes recompilation, like in a loop.

Have you checked the dynamic compilation optimization?

If you want to be able to modify top-level files without calling the entire site to be recompiled, you can set the optimizeCompilations attribute of the compilation element in the Web.config file true .

Note. For use in the .NET Framework 3.5, a fix is required to use this option.

entrance

Do you already have a registration solution connected to the asp.net infrastructure?

The minimum to be able to investigate problems is ConsoleLogger (visible from a web browser) or Logger writes log events to a file .
Then you should configure LogLevel as a minimum: Debug or Verbose should do the trick.

There are also several third-party protocols that can be connected to System.Diagnostics to provide more features.

General tips

If you have a problem with an error, for example, recompile in a loop, try to reproduce it on the developer's machine. It will be easier to debug the recompilation process step by step. This article about what happens during recompilation can help you. In general, the deployment and compilation process is even more complete, but for ASP.NET 2.0

If you have performance problems, you should profile your website on the developer's machine, a pin-point where there are real performance problems and a fix.

0
source
  • Clear temporary directory under Microsoft.Net
  • Run chkdsk on disk
  • Temporary anti-virus protection / anti-spyware program
  • Use the sysinternal filemon tool to check if someone (other csc.exe and w3wp.exe) has access to the dotnet temporary directory
0
source

Source: https://habr.com/ru/post/1235843/


All Articles