Question

I have recently decided that the assembly name for my solution needs to be changed. The issue is that this solution has tons of web parts active in all different site collections and none will work if the assembly name is changed.

How can I fix this without deleting & reconfiguring every webpart? I have been unsuccessful with powershell thus far. Is there another method?

Update: There does not seem to be a simple way to update this. I will try to persue a powershell solution & return it here at a later date.

Was it helpful?

Solution

I truly hope someone has a better answer but if not here are a few options:

  1. Leave the name the same
  2. Edit every single web part in all sites and replace and reconfigure it so that it uses the new DLL. This could be enormous depending on your farm
  3. Create a new project with the name you want but leave the existing project intact and maintain them as two separate projects.
  4. Move all common code into a third DLL and simply use the old and new DLL names as little more than entry points. This would require three projects in total (common DLL, Old DLL, New DLL) but would let you maintain code in one place. The revised version of the old project would have to be deployed once for the change to take effect but could be left alone after that.

option #3 is simplest but leads to duplicate code.
option #4 is the most complicated but offers the easiest path to upgrade existing.

OTHER TIPS

Not necessarly, it really depends on how your solution was built. Basically, if you used out-of-the-box ways of creating web part in Visual Studio 2010, tokens for Class names and Assembly names are automatically created in the Elements.xml files, and replaced during compilation (you'll find something like $SharePoint.Project.AssemblyFullName$).

Example for a .webpart file

<?xml version="1.0" encoding="utf-8"?>
<webParts>
  <webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
    <metaData>
      <type name="AccordionWebpart.VisualWebPart1.VisualWebPart1, $SharePoint.Project.AssemblyFullName$" />
      <importErrorMessage>$Resources:core,ImportErrorMessage;</importErrorMessage>
    </metaData>
    <data>
      <properties>
        <property name="Title" type="string">VisualWebPart1</property>
        <property name="Description" type="string">My Visual WebPart</property>
      </properties>
    </data>
  </webPart>
</webParts>

These are all detailed here http://msdn.microsoft.com/en-us/library/ee231545.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top