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.

Comments

# Twitter Trackbacks for Use those version numbers in SharePoint 2010 - Corey Roth - DotNetMafia.com - Tip of the Day [dotnetmafia.com] on Topsy.com

Pingback from  Twitter Trackbacks for                 Use those version numbers in SharePoint 2010 - Corey Roth - DotNetMafia.com - Tip of the Day         [dotnetmafia.com]        on Topsy.com

# Social comments and analytics for this post

Saturday, October 24, 2009 7:25 PM by uberVU - social comments

This post was mentioned on Twitter by coreyroth: #spc09 Post: Using BindingRedirect in solution packages. http://tinyurl.com/yhr5kyh #sp2010

# SharePoint 2010: Versionado de ensamblados y binding redirect!

Friday, December 2, 2011 5:12 PM by Blog del CIIN

Unas de las dificultades cuando se desarrolla para SharePoint es la relativa al versionado de ensamblados

# SharePoint 2010: Versionado de ensamblados y binding redirect! &laquo; Pasi??n por la tecnolog??a&#8230;

Pingback from  SharePoint 2010: Versionado de ensamblados y binding redirect! &laquo; Pasi??n por la tecnolog??a&#8230;

Leave a Comment

(required)
(required)
(optional)
(required)