SharePoint Features + Renaming

sharepoint

This is a fun one. In some of our Visual Studio solutions we use the period character – “.” – for project naming which broadly reflects the namespaces in use.

However, this causes issues for Visual Studio namely in the ability to rename features. So when you create a feature, it will adopt a default name of Feature1 and it’s not possible to rename it directly from within the solution.

Fortunately, there’s a nifty workaround that does appear to work, without having to redo your solution/project structure and naming convention. Found via this post:

I use SharePoint 2010 projects in VS2010 with TFS and have some sort of hack to rename newly added feature with default name “Feature” to the project. 1) Exclude feature from the project – it will disappear in the project tree but will still visible if you click “Show All Files” 2) Rename file “Feature1.feature” and its parent folder via the properties window or right click on the feature file and select “Rename” option. Make sure that file “Feature1.feature” and its parent folder have the same names e.g. “ListsAndContentTypes.feature” for feature file and “ListsAndContentTypes” for the parent folder 3) Right click on the parent feature folder (in example above “ListsAndContentTypes” ) and click “Include in project” Now the feature file have appropriate name. 4) Make sure that it is included in the package – check the “Package” project item.

Handy.

Be the first to comment

Leave a Reply

Your email address will not be published.


*