Friday, October 26, 2007

.NET Tip of The Day: Speed up Visual Studio 2005

If you like me, are in Visual Studio a good portion of your day, then this list of tips is for you. These are some good tips that will help you to not be so frustrated with how slowly VS runs. I just applied these this morning and already I have noticed a difference. Obviously, your mileage may vary, but at least consider trying them out to see if they make a difference.

.NET Tip of The Day: Speed up Visual Studio 2005

Thursday, October 4, 2007

Combine multiple stylesheets at runtime


Mad Kristensen (founder of BlogEngine.Net) has written a great article titled Combine multiple stylesheets at runtime. In the article he outlines the process of combining multiple stylesheet references from the head tag on a page into one http request instead of the multiple ones and he also throws in some performance gains via whitespace removal and browser caching.

The ability to combine stylesheet requests is something that I have looked at in the past for one of our applications and never quite found the right solution. However, this solution looks very promising for the following reasons:

  • Provides the ability to reference a stylesheet inclusion in the normal HTML markup (note that your head tag must have the runat='server' attribute applied).
  • Efficiently leverages browser caching without the need for modifying content expiration via Http Headers on files/directories within IIS.
  • Satisfies Best Practice #1 Make Fewer Http Requests of the Yahoo Developer Network Best Practices for Speeding Up Your Web Site. (Note you can grade the performance of your web site using YSlow for FireFox.)
  • Provides a file dependency for all of the scripts that make up the caching of the generated combined script so you can update those files dynamically as needed.

Granted there is the initial IO overhead the first time of the combined requests needs to be generated, but I think that is a small price to pay for longer term performance increases in your web application.

Wednesday, October 3, 2007

VS 2008 Multi-Targeting Issue & FxCop

Krzysztof Cwalina (one of the Microsoft CLR designers) points out that while VS 2008 Mutli-Targeting Support is a great thing, there are some limitations/situations where you could build and test an application on a machine with VS 2008 (and thus .NET 3.5, 3.0 & 2.0) installed and compile and run that code without issue. However, if you run (or even compile) that code on a machine with only .NET 2.0 installed you will receive a run-time error because it is using members that are not present in the .NET 2.0 framework. He was kind enough to create a set of FxCop rules that can detect this issue and warn you before you go throwing run-time errors when you deploy your application.

Please reference Krzysztof's article FxCop Rule for Mutli-Targeting for a more thorough discussion of the issue as well as a link to download the FxCop rules.

Source Control & Branching

As Jeff Atwood points out in his article Software Branching and Parallel Universes, branching within source control software is a feature that is rarely used. I know I personally do not completely understand the power and benefits of branching; and as a result I have been reluctant to use branching. However, after reading this article and studying the examples I feel that I have a better understanding of the benefits and approaches to branching. This is a good read for anyone that uses source control (which should be all developers).

Monday, October 1, 2007

CopySourceAsHtml and VS 2008

The CopySourceAsHtml Visual Studio add-in is an invaluable tool for me, especially for creating blog posts. However, I was concerned that I would not be able to use it with Visual Studio 2008. That is, until I did a quick Google search and found that Andreas Erben posted Using CopySourceAsHtml with Visual Studio 2008 Beta 2. The steps are very easy, if you use this tool and want VS 2008 support, it is well worth the few minutes of your time.