문제

I just created a couple of site columns and content types that reference them through VS2010. I updated one of the fields and then tried to redeploy, but after retracting, deploy failed because the site columns previously created were still there. I tried to delete them manually from the UI, and got an alert box with this message:

Site columns which are included in content types cannot be deleted. Remove all references to this site column prior to deleting it.

I dug around in SharePoint Manager and didn't find any references, so I used powershell to enumerate all the content types and lists looking for references to my site columns and found nothing.

I tried to delete using PowerShell like this:

$web.Fields.Delete("StartTime")

which resulted in this error:

Exception calling "Delete" with "1" argument(s): "Site columns which are included in content types or on lists cannot be deleted. Please remove all instances of this site column prior to deleting it." At line:1 char:19 + $web.Fields.Delete <<<< ("StartTime") + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : DotNetMethodException

Finally, a simple inspection of the columns in PowerShell shows the following:

Title Id CanBeDeleted ParentList Sealed ListsFieldUsedIn
----- -- ------------ ---------- ------ ----------------
Start Time OBE 6fa0d85b-9af1-408b-835f-d4c66536... True False {}
Time Tracker Tags 92bc866b-0415-45f0-b431-d4df69c4... True False {}

I'm experienced with MOSS 2007 and new to SP2010, but I've never seen this happen before. Anyone have any hints?

도움이 되었습니까?

해결책

So you did deployed your column via a Feature right? This also means that you won't be able to remove it manually.

You need to make sure you emptied the Recycle Bin (both sub-sites and site collection) to attempt removing used references. Than try to remove again your feature.

ON YOUR OWN RISK (i did successfully fixed some CTs this way...but you never know):

use this to locate information about your column http://blog.sharepointsite.co.uk/2011/05/corrupt-site-column-cannot-be-deleted.html

and then use this http://blog.tylerholmes.com/2008/02/deleting-content-types-in-sharepoint.html to actually delete the offending CT with its columns.

다른 팁

If you go to "Site Actions > Manage content and structure" and find the offending item - there's a button to show item dependencies. This way you can weed out what is still using the field and remove it before removing the field altogether.

Isn't "StartTime" an built-in column used by the Tasks content types?

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