The field with Id {} defined in feature {} was found in the current site collection or in a subsite

Tue, Nov 1, 2011 2-minute read

This is a known bug in Visual Studio. It seems to occur most often when using VS to deploy (and redeploy) declarative content types to a SharePoint site. I’ve seen it happen most often when deploying List Definitions and List Instances. There are a variety of steps out there to try to make it go away:

  1. Retract solution, close VS, restart VS, deploy solution.
  2. Deploy project, attempt to activate via UI, deactivate, retract, restart VS, deploy solution.
  3. Deploy, retract, deploy. Open Task Manager, kill VSSHostP4.

Deploying after this should be resolved.

Error activating features. Field ” could not be found, it may have been deleted by another user.

This is not a bug, more of an irritation. If you’re deploying List Instances using Visual Studio, you may see this if you create your List Definition/Content Type/Fields, but then forget to add the Fields to your List Schema. At the top of the Schema, you can supply a ContentTypeRef (the ID of your Content Type) and then in the Fields collection, essentially copy your Field definitions in.

Other deployment related issues

One other issue you may encounter is in the ordering of items in your Feature/Package. It might seem obvious but you must ensure things are ordered in the way that they will be needed during deployment. That is,

  • Fields
  • Base content types
  • Content types that inherit base content types
  • Anything that uses the content types and fields, e.g., Document Set Content Type. Note: if your Document Set is using a custom Welcome Page (deployed via a module/element), this must be deployed first
  • List definitions
  • List instances
  • Anything else

You can arrange the deployment order in the Feature designer screen. But be warned- if you’ve got a lot of Elements in your project (and multiple projects in a solution), then it’s a pretty gnarly process.

Other deployment pointers? Leave a comment below.