Tip/Trick: Optimizing ASP.NET Build Time with Dynamic Compilation (optimizeCompilations=”true”)
If you are experiencing slow builds with ASP.NET projects or want to learn how to speed them up please read on.
Microsoft has introduced a new optimizeCompilations switch in ASP.NET that can greatly improve the compilation speed in some scenarios. You can read this blog post to understand the overall idea, study a more detailed explanation about Dynamic Compilation here or simply follow these 2 easy steps:
1) Install this hot-fix:
- Windows XP: http://code.msdn.microsoft.com/KB969612
- Windows Vista: http://code.msdn.microsoft.com/KB967535
- Windows 7 – not necessary
2) Update your web.config as follows:
Add optimizeCompilations=”true” to your <compilation …> tag. Below is an example:
<system.web>
....
<compilation debug="true" optimizeCompilations="true">
....
</compilation>
....
</system.web>
And you’re done! Next time you change something inside the App_code or even a dll inside the bin folder you might not have to wait the entire site to rebuild.
Important note: this approach speeds things up but you might get some weird errors when you start changing some code signatures or restructuring dlls.In this case, all you need to do is a simple “rebuild project/solution” inside your Visual Studio to get things straight again.
Yet Another Budgeting System – YABS
Yet Another Budgeting System (http://code.google.com/p/yabs-online/) is a web-based ajax-enabled application with the intent to provide a simple yet complete solution to manage my personal home finances. It borrows budgeting concepts of a great product I use and recommend called ‘You Need A Budget’ (YNAB). See more details at: http://www.youneedabudget.com
However, the real motivation behind this project is to keep me updated with latest trends in the Java/J2EE world. There are countless interesting Java frameworks and tools, but for this project I’ve picked the following winning set: JSF, Facelets, RichFaces, Spring and Hibernate!
So, this project does not have real schedules or documented requirements. It’s a fun and open project that is always there for me, just waiting to be updated the latest trends in java development!
By the way, the current technologies in place for this version are:
- JSF 1.2 / Apache MyFaces 1.2.3
- Facelets 1.1.14
- RichFaces 3.2.1
- Spring Framework 2.5.5
- Hibernate 3
- HSQLDB 1.8.0
- JUnit 4.4
If you have any questions or would like to participate, just leave a comment here.
How To Deploy an ASP.NET web application using Team Foundation Server
Here is a quick tip on how to modify a TFS build script to publish an ASP.NET site to an existing IIS server (i.e. development environment).
Sample Code
Assuming you have created your basic TFSBuild.proj file, add this to the bottom of the file (right before the </project> tag):
<!– This task will be executed after the build is copied to the drop location (i.e. build storage) and
will take care of automating the deployment of the project to an IIS folder
by ‘Wagner Danda da Silva’
–>
<Target Name=”AfterDropBuild” Condition=” ‘$(BuildBreak)’!=’true’ “>
<!– Let’s prepare the copy by setting the drop location (IIS website folder) ** –>
<CreateProperty Value=”\\dswebdev\QA\“> <!– replace this with your IIS folder –>
<Output TaskParameter=”Value” PropertyName=”MyDropLocation”/>
</CreateProperty>
<!– The path below is where the sources can be found after building ASP.NET projects, you probably won’t need to edit this. –>
<CreateItem Include=”$(DropLocation)\$(BuildNumber)\%(ConfigurationToBuild.FlavorToBuild)\_PublishedWebsites\Web\ \*”>
<Output TaskParameter=”Include” ItemName=”MyDropFiles”/>
</CreateItem>
<!– Let’s remove any pre-deployed files. This will delete any existing files inside all folder and subfolders of the drop location. I opted not to use the default TFS delete task because that was removing security permission on my folders and messing up with my build. The command below won’t do that, will simply delete old files (but it won’t remove the folders, so if you deleted a folder on your source code you’ll have to manually remove it from the drop location – if you actually care for that
–>
<Exec Command=’del /f /s /q $(MyDropLocation)\*’/>
<!– Copy the files from the build drop location to the IIS website folder –>
<Exec Command=’xcopy /Y /R /E “$(DropLocation)\$(BuildNumber)\%(ConfigurationToBuild.FlavorToBuild)\_PublishedWebsites\Web\.” “$(MyDropLocation)\."’ />
</Target>
More details can be found here:http://tfsdeploy2iis.codeplex.com/
Release of the new RichFaces project site
The RichFaces project has recently released a new project site, check it out: http://www.jboss.org/richfaces