문제

Well it seems like this is a problem some people are having, but I can't seem to find the definite solution.

I deployed some Site Columns to Sharepoint using a feature, let's go with the following example:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <Field Type="Text" DisplayName="Test" StaticName="Test" Name="Test" Group="Group" ID="{12C5DE50-14B1-425C-8A5B-7430726526E1}">
    </Field>
</Elements>

Now I wanted to add a second column to my "deployment package" (leaving in the first column/field with the same ID as previously deployed). So I added said column to my package, retracted the previous solution, but now get the error:

Error occurred in deployment of step ‘Activate Features’: the field with ID defined in feature was found in the current site collection or in a sub site.

It is suggested here on MSDN blogs to "close and re-open Visual Studio" or "to retract the feature, re-deploy, close and re-open". Nothing of that seems to work.

A french site suggested using Overwrite="TRUE" OverwriteInChildScopes="TRUE" for the Field definitions - I did so and instead of getting the "ID existing" I now get the error (please see my answer below! Overwrite=TRUE is the solution)

Error occured in deployment step 'Activate Features: A duplicate field name "Test" was found.

  • When checking Sharepoint (Site Settings > Site Columns), my "existing" columns are nowhere to be found
  • I did an IIS reset, I did close, re-open and swung my magic stick with Visual Studio

I read something about a "stale cache" Sharepoint uses... I do not want to change the GUIDs on the fields every time I deploy anew the same as I don't want to cludder up Sharepoint with old remnants of non-existing fields.

How do I really remove all references to these previously deployed fields?


EDIT: I now even tried a code based deletion approach: Iterating all fields via SPWeb.Fields. The fields are not even to be found like this - yet I cannot deploy them.

도움이 되었습니까?

해결책 2

I still don't know how to really delete fields - but actually Overwrite="TRUE" OverwriteInChildScopes="TRUE" for the field WORKS!.

The second error message i received ("duplicate field names") is actually due to two identical fields being defined in my .xml file.

다른 팁

I have noticed that if you deploy a site column in a feature, then retract the solution, then deploy again, the feature is no longer listed in site columns. However, if you do an IISRESET and then check site columns, the column reappears. This suggests that SharePoint is cacheing the schema at some level. So my recommendation would be to force an iisreset after redeploying schema changes which should result in slightly more consistent behaviour.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top