Freigeben über


How to Rename a Feature Extension

When you create a Feature Extension, the name of the Feature Extension is calculated by copying the name you provide for the solution/project.

This name is stored in multiple places within your Feature Builder solution as it is required by multiple components at both build and runtime (Extension Manager, MEF, etc).

You can change the name of your Feature Extension by following the steps below.

It is not necessary to change the name of the solution or any of the projects or files.

To change the name of your Feature Extension follow the following 3 steps:

In Feature.cs

  • #1 Change:

[Feature("FeatureExtension30")]

Open the VisualStudio folder, right click on source.extension.vsixmanifest and select View Code

  • #2 Change:

<Identifier Id="FeatureExtension30">

  • #3 Change:

<Name>FeatureExtension30</Name>

You may also want to change the following (not required):

  • In VisualStudio\source.extension.vsixmanifest:

<Description>FeatureExtension30 Feature Extension</Description>

In Templates\Projects\Feature Extensions\MyTemplate.vstemplate (if you are using the default template supplied with your Feature Builder solution)

  1. <Name>FeatureExtension30</Name>
  2. <Description>Project template for creating an instance of FeatureExtension30</Description>
  3. <DefaultName>FeatureExtension30</DefaultName>

Note: Accidentally using the GUI editor to edit the .vsixmanifest of a Feature Extension will remove the following two tags shown below from inside the <Content> section. If you do edit the .vsixmanifest file using the GUI editor, be sure to re-add these two tags using the XML editor or your item and/or project templates will not be properly installed.

<ItemTemplate>Templates\Items</ItemTemplate>

<ProjectTemplate>Templates\Projects</ProjectTemplate>