开发者

How do I speed up compilation of hundreds of user controls?

开发者 https://www.devze.com 2023-01-24 13:00 出处:网络
I\'m developing on a site with a few hundred user controls. When debugging the web app (pressing F5 in Visual Studio 2008), it takes quite some time to compile it and start Cassini. I\'ve noticed that

I'm developing on a site with a few hundred user controls. When debugging the web app (pressing F5 in Visual Studio 2008), it takes quite some time to compile it and start Cassini. I've noticed that every user control is compiled to a separate dll in temporary asp.net-files and it takes quite a lot of time.

Is it possible to speed up this process, possib开发者_JAVA百科ly by compiling to just one dll, and still be able to debug the web application?


This is from the article: http://weblogs.asp.net/scottgu/archive/2006/09/22/Tip_2F00_Trick_3A00_-Optimizing-ASP.NET-2.0-Web-Project-Build-Performance-with-VS-2005.aspx

Enable the on-demand compilation option for your web-site projects. To enable this, right-click on your web-site project and pull up the project properties page. Click the "Build" tab on the left to pull up its build settings. Within the "Build" tab settings page change the F5 Start Action from "Build Web Site" to either the "Build Page" or "No Build" option. Then make sure to uncheck the "Build Web site as part of solution" checkbox:

Have you considered moving to a web application project? That will compile all of your code into one dll, but this could be a big change. I would try changing the start options first.


A few tips in here, which helped (batch="false" in web.config and moving the temp-files to a ram-disk):

http://blog.lavablast.com/post/2010/12/01/Slash-your-ASPNET-compileload-time.aspx

Also, consider building in parallel: http://www.hanselman.com/blog/HackParallelMSBuildsFromWithinTheVisualStudioIDE.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消