Debugging long compilation times in the App_Code directory

I have a website based on a .NET 4.0 ASP.net project template. Suddenly, when I restore my solution, the App_Code directory receives awards for 3-4 minutes to compile (depending on what is displayed in the Output window). There are only about 13 classes in this catalog, and they are all very small.

I tried to transfer these files from the App_Code directory to a separate class library project, but some of them depend on the System.Web.Security namespace, which cannot be added to the project without a website.

What is the best way to debug this method to determine what the compilation process fades in?

+6
source share
3 answers

If you cannot move app_code files due to network dependencies with another project, then moving them to the same project in a different folder will not do you any good.

  • Website projects take some time to build, longer than web application projects. So, see if you can convert it.

  • You can also try setting optimizeCompilations = "true" in the compilation tag.

  • Change the build project setting to only compile the current page to run or debug

More links - https://msdn.microsoft.com/en-us/library/aa730880(VS.80).aspx

+1
source

Unfortunately, the App_Code directory is a black box and you cannot watch file by file. I tried switching to the web application template, but this was complicated by the fact that I rely on the profile provider structure, which is not supported by default.

I think the best solution is to completely eliminate this pattern. I am going to deal with slow compilation time until I can completely switch to MVC. This is especially important since .NET 5.0 (Core) does not support Web Forms at all.

+1
source

try setting the batch = "false" property in the Web.config file

<compilation debug = "true" targetFramework = "4.0" batch = "false">

0
source

All Articles