Use those version numbers in SharePoint 2010
Posted
Wednesday, October 21, 2009 12:59 PM
by
CoreyRoth
With MOSS, it seemed like most web part developers tended to avoid changing the version of their DLL, because it lead to numerous headaches as you had to update the .webpart file. You also had to update any page that you might have the web part on as well so that it would load the new version. What’s nice about SharePoint 2010 is that your manifest file in your solution package can now deploy binding redirects to your web.config. For example, this means you can have any reference to version 1.0.0.0 redirect to use version 2.0.0.0. Binding redirects are nothing new to .NET, it’s just that SharePoint is now taking advantage of this feature. In fact, SharePoint uses this feature itself to redirect any calls to its DLLs from version 12.0.0.0 to 14.0.0.0. Here is an example of what that might look like.
<Assemblies>
<Assembly DeploymentTarget="GlobalAssemblyCache" Location="MyWebParts.dll">
<BindingRedirects>
<BindingRedirect OldVersion ="1.0.0.0" />
</BindingRedirects>
<SafeControls>
<SafeControl Assembly="MyWebParts, Version=2.0.0.0, Culture=neutral" Namespace="MyWebParts" TypeName="*" Safe="True" />
</SafeControls>
</Assembly>
</Assemblies>
I really like this new feature and I think it will make it much easier for developers to version their assemblies.