Вопрос

Я недавно решил, что имя сборки для моего решения необходимо изменить.Вопрос в том, что это решение имеет тонны веб-частей, активных во всех разных коллекциях сайта, и никто не будет работать, если имя сборки изменено.

Как я могу исправить это без удаления и перенастройки каждого веб-парада? Я был неудачным с PowerShell до сих пор.Есть ли другой метод?

Обновление: Кажется, не простым способом обновить это.Я постараюсь предположить решение PowerShell и вернуть его здесь позже.

Это было полезно?

Решение

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.

Другие советы

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с sharepoint.stackexchange
scroll top