Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging Long Compile Times in App_Code directory

I have a website based on the .NET 4.0 ASP.net project template. All of a sudden when I'm rebuilding my solution the App_Code directory takes awards of 3-4 minutes to compile (based on what is displayed in the Output window). There are only about 13 classes in this directory and they are all very small.

I've tried to move these files out of the App_Code directory to a separate class library project, but some of them depend on the System.Web.Security namespace which can't be added to a non-website project.

What is the best way to debug this to determine what is bogging-down the compile process?

like image 676
bperniciaro Avatar asked Dec 21 '15 03:12

bperniciaro


People also ask

What is the use of App_Code directory?

The App_Code folder and its special status in an ASP.NET Web application makes it possible to create custom classes and other source-code-only files and use them in your Web application without having to compile them independently.

What is use of App_data and App_Code folder?

These files are often used to help support mobile application. App_GlobalResources folder contains resources (. resx and . resources files) that are compiled into assemblies and have a global scope.

Which ASP NET folder contains code files that are dynamically compiled for use in your application?

In a dynamically compiled application, ASP.NET compiles the code in the App_Code folder on the initial request to your application. Items in this folder are then recompiled when any changes are detected. Arbitrary file types can be placed in the App_Code folder to create strongly typed objects.


1 Answers

In case you can't move app_code files due to web dependency to another project then moving them into the same project in another folder will not give you benefit.

  1. Website projects take awhile to build, longer then web app projects. So, see if you can convert it.

  2. You can also try setting optimizeCompilations="true" under compilation tag.

  3. Change the build project option to compile only the current page on run or debug

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

like image 193
jitendra singh Avatar answered Sep 30 '22 12:09

jitendra singh