Over a million developers have joined DZone.

Versioning Your Silverlight Application

DZone's Guide to

Versioning Your Silverlight Application

· ·
Free Resource

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:

  1. Create an abstracted file that contains your version number, or
  2. 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.*.



Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}