question

MarkKharitonov-4071 avatar image
0 Votes"
MarkKharitonov-4071 asked MarkKharitonov-4071 commented

How to improve performance of aspnet_compiler?

The command line is:

 C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v xyz -p D:\_wf\01\69\b\_PublishedWebsites\xyz -fixednames D:\_wf\01\69\b\_PublishedWebsites\xyz_Precompiled

The result is 180 files with the .compiled extension. On the build server this runs for about 28 minutes. Usually we just run the following command:

 C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v temp -p D:\_wf\01\69\b\_PublishedWebsites\xyz

And it takes about 14 minutes. Either way it is very long.

I tried to debug the aspnet_compiler and it seems it compiles each of the relevant files one by one.

Our code is Asp.Net, not Asp.Net Core. Is there any solution to this build performance problem?

I have asked a few related questions on the StackOverflow, but got no satisfactory responses:

  1. https://stackoverflow.com/questions/71329184/are-there-any-alternatives-to-aspnet-compiler-when-it-comes-to-build-the-asp-net?r=SearchResults&s=1%7C53.0356

  2. https://stackoverflow.com/questions/70103543/how-to-speed-up-aspnet-compiler-exe?r=SearchResults&s=2%7C13.4642



vs-msbuild
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, the asp.net_compiler.exe tool compiles each ASP.NET page in the project. I suppose its compile time depends on this reason.

0 Votes 0 ·

This does not explain the abyssmal performance. C# compiler also compiles each and every *.cs file in the project, yet it does not take that much time.
Is there an alternative to aspnet_compiler? Someone proposed to use Roslyn to compile asp.net templates, but without providing the concrete details on how to actually do it.
The StackExchange team has built their own precompiler, I forked it and tried to use - https://github.com/MarkKharitonov/StackExchange.Precompilation
But it is too old and unable to cope with all kinds of scenarios, for example - https://stackoverflow.com/questions/71632811/error-cs0012-the-type-is-defined-in-an-assembly-that-is-not-referenced-you

0 Votes 0 ·

0 Answers