Assembly Versioning

You want to know how to version your assemblies and any potential pitfalls.

Edit the AssemblyVersion(“”) attribute in the AssemblyInfo.cs file, and give the assembly a specific version number. Change the version number when you publish a new version of the assembly.

Specifying a version number is important because it gives the assembly a strong name. One gotcha: If you use an asterisk in the version number, the version number changes each time you recompile the assembly. As a result, all client assemblies have to be recompiled and the identity of any enclosed types will change. Further, this will lead to problems when deserializing an object that was serialized by a previous version of the same assembly.


// Incorrect. Uses an asterisk.
[assembly: AssemblyVersion("1.0.*")]

// Correct. Remember to change as needed.
[assembly: AssemblyVersion("")]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s