Versioning Your Silverlight Application
When writing an enterprise level application it’s critical to have a version number. Whether it’s located on the help screen or in debug mode, this will save you so much heartache during QA. The larger the project, the more dependent your team is on the version.
Now that I’m all done ranting to the converted, let’s talk about Silverlight. From my past experience there are two ways to handle versioning:
- Create an abstracted file that contains your version number, or
- Use the Assembly version.
Both have their pros and cons. Option 1 gives you greater control of the version number, however the manual process is tedious. Option 2 enables you to use the Assemblies version, however it provides less control over the version number. Lately I’ve been going with option 2 because it takes one more step out of my deployment process.
To get the version from the Assembly
Doing this is fairly easy once you have the correct block of code. The below block of code shows how to get the version from the Assembly in the MainPage_Loaded method. Do not forget to include the System.Reflection reference.
![]()
Given the above block of code, the next question is, where is this assembly version defined? In short, the AssemblyInfo.cs file, which is located in the Properties folder.
At the bottom of the AssemblyInfo.cs file, you’ll see the version info. The directions are in the comments on how to change this. I’ve customized my version to be 0.611.*.

Over the past year Corey was a lead developer on the NBCOlympics.com Silverlight 2 video player, he is currently finishing up a book with PeachPit Press - Microsoft Expression Blend a Visual Quickstart Guide (ISBN 0-321-41223-0), and he maintains a Silverlight blog “Silverlight made Simple”. Other Silverilght project he has worked on are HSN.tv with Silverlight 1.0 and the Blockbuster Stream application using Silverlight 2. Corey is a DZone MVB and is not an employee of DZone and has posted 9 posts at DZone.
- Login or register to post comments
- 404 reads
- Printer-friendly version
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)










Comments
bet replied on Mon, 2009/06/29 - 2:29pm