What to know about the feature folder

One of the first things I used to tell guys new to SharePoint development is: Never ever name the folder of your feature “Feature1”. If you create a solution with WSPBuilder, or did some time ago with VS 2008, you have to rename the folders immediately!

image

This is how a typical SharePoint project looks like, if you create features. I guess most of us have used the mighty WSPBuilder ( http://wspbuilder.codeplex.com) for developing with SharePoint.image

After building the VS solution and creating a WSP package with WSPBuilder, the wsp contains two folders. They reflect the names, we defined in VS.

 

 

Now lets take a look at the same features in a Visual Studio 2010 SharePoint Solution.

image

It almost looks the same as a WSPBuilder solution in VS 2008.

The features have been created by right-clicking on the Features folder in the Solution Explorer. This is important.

In many places VS uses tokens to replace strings with certain solution specific values like the assembly name. You can take a look at the tokens here: Replaceable Parameters

If we look at the wsp again, we notice the difference. Visual Studio 2010 hasimage added the solution name as prefix to the feature folders. Great. Thank you Microsoft. Now we can name our feature folders e.g. after the scope. (Site, Web, Webapplication of Farm), and do not have to worry about duplicate names.

The magic of this can be seen, if we take a look at the properties of the feature folders.

image

Conclusion: VS 2010 is a great improvement to us SharePoint developers. We don’t have to know all the places where it helps, but it can’t hurt, either. I hope this article brings a little light to the magic 🙂