I imported a WSP (site template) in VS 2010 and compiled. I then tried to create a package (build > package). I am getting all sorts of issues. Why is that? The site templated was created using an existing subsite (and subsite has publishing activated). Onet.xml has the publishing feature but when creating a site using this WSP I don't see this feature being turned on.

What issues are you getting, other than the Publishing Feature not activating? (There is a reason behind this - you shouldn't be able to export a Publishing Site as a template).
–
James LoveMay 2 '11 at 20:45

@James: The features are labeled like feature1, feature2, etc. Also, its brining everything, like workflow. and the source site where the template was generated from doesnt even use workflow. How do I activate publishihg? Why then SP included publishing code when creating WSP? Is there a good link on this?
–
arjun rampalMay 2 '11 at 20:53

can you provide more information about the packaging errors?
–
Andrey MarkeevMay 2 '11 at 21:23

<NavBarLink is not part of the NavBar parent, then why the world they (sp) put that in that segment. File path is too long?
–
arjun rampalMay 2 '11 at 21:52

1 Answer
1

The SharePoint 2010 site template has two functions. Firstly to replace the old .stp files from MOSS which were used to create new sites from a template (and did not support publishing sites). Secondly as a starting point for development by importing them into Visual Studio.

They seem to do the first job adequately, at least as well as the old .stp files. As a starting point for development the big drawback is that they pull everything in, including all the built-in list definitions and other artefacts. This makes them quite unwieldy for a developed solution package. If you are just using them as a template without further development this isn't really a problem.

For development work, the recommended approach is to use the imported .wsp as a way of generating the CAML and cherry-pick what you need, and bring those sections of code into a new project you create which will be much simpler. You can also select which parts of the site you are interested in when importing the template to reduce the amount of XML you are working with in the imported site.

So, in summary, as a tool for helping build solution packages for deploying custom site templates this is a really useful tool, and a great improvement over what we had before. As a way of generating complex custom solutions with a similar experience to using SharePoint Designer; no, we are not there yet, and probably never will be.

Note: original question was more general, along the lines of "what is the use of WSP site template". Question has since been edited down to a specific issue, leaving my answer somewhat out on a limb.
–
SPDoctor♦May 5 '11 at 11:06