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?
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.
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.
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.
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.
Website projects take awhile to build, longer then web app projects. So, see if you can convert it.
You can also try setting optimizeCompilations="true" under compilation tag.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With