One of the first things I noticed when I started to develop SharePoint solutions for 2010 with the new project template in visual studio 2010 was the new feature capabilities.
First of all the new features folder which nicely brings all my features together in one common place. It seems like Microsoft has taken a kind of new approach with features in 2010. Features are now somewhat a place where you package up things to provision to SharePoint.
OK, what I mean with this is that in 2007 features where somewhat overused I think. The approach was that you always started with a new feature which in some places led to having too many features in the features folder. In 2010 you start with the things to provision (modules, content types, lists etc) and then package them up as features and sometimes move stuff around between features instead.
I actually started to use features like this in “2007 land” and my solutions for SP2007 had one feature at the site collection level which sometimes activated other “hidden” features. Now I can think of things a bit differently I hope…
So, what´s the “problems” with features in 2010 then…??
Have a look at the feature “Feature1” that I created above (the first image). When I build the WSP file (image above) with VS2010 and have a look at the structure of it the name has “changed” to SharePointProject_Feature1. This is really [projectname]_[featurename]
That´s a bit odd I think. There is an explanation though.
First of all, Microsoft now thinks that our features should have a name which “enables” me to see what features belong to what project (or wsp)…that´s why they have added the project name stuff.
OK, so personally I have used that syntax already back in 2007 (just for that reason) but why the underscore in there then?
Looking at the feature properties we can see that first of all we have a couple of them nice “replacement parameters” that make up the deployment path. But as you can see there is an underscore inserted between the two parameters. OK, so just go in and edit that underscore and make it into a dot instead…build the WSP again and…
Now we have a “nicer” looking path/name again. And if you don´t like the [projectname].[featurename] syntax…just remove the first replacement parameter and…
You can really make it look anyway you like (but keeping a common syntax among your features might be useful).
The only thing I miss about this new feature is the ability to use a common setting for this for my entire project…now I have to manually update this for all my features…or have I missed that somehow?