Change FeatureId in Visual Studio 2010

Within Visual Studio, the “tooling support” for SharePoint 2010 is great – but there are still a few holes & gotcha’s.

I have a set of THREE features that I routinely deploy for the ‘branding’ of a new site – including feature stapling that applies the branding to any new sub-sites and so forth.

With a new project, I’d taken a copy of these features – and wanted to “isolate” these features within the same VM.    So – I thought I’d simply change the GUID for each of the features :

image

This GUID is being referred to in another location – ELEMENTS.XML – which is a text file, stating which site templates to ‘staple’.    So – that’s an easy fix.

BUT – the package doesn’t deploy though – with an error for one of the features missing…(??)

After some investigation and checking, it turns out that there are (can be) two identifiers within the ‘Feature’ file ;

  • Id
  • FeatureId

image

I don’t know if this was a problem with *MY* feature files – but I had to do the following to fix it :

  • Close Visual Studio 2010
  • Open Windows Explorer
  • Locate the ProjectFeatures folder
  • Open the “.feature” file
  • Ensure that the “Id” and “FeatureId” were the same value
  • Re-open Visual Studio 2010 – and deploy
  • It worked !

Has anyone else had a similar problem ?  

Hope this helps – assuming it actually is a ‘problem’ for other people – and wasn’t just some dud text in my SharePoint feature file/s !!

Smile

Advertisements

2 thoughts on “Change FeatureId in Visual Studio 2010

  1. Pingback: Change FeatureId in Visual Studio 2010 « hungleo

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s