SharePoint Developer Support Team Blog

The Official blog of the SharePoint Developer Support Team

SharePoint 2010 Environment can get corrupt when deploying and retracting a WSP solution that was created using “Save site as template” option

SharePoint 2010 Environment can get corrupt when deploying and retracting a WSP solution that was created using “Save site as template” option

  • Comments 2
  • Likes

This post is a contribution from Amy Luu, an engineer with the SharePoint Developer Support team.

Steps to repro this problem:

1. Create a new team site in SharePoint 2010 and save this site as template (ts.wsp).  Download the WSP to your local drive.

2. Launch VS 2010 professional.

3. In Visual Studio, File > New > Project, select “SharePoint” Template > “Import SharePoint Solution Package”.  Note: Make sure .NET Framework 3.5 is selected.

image

4. Clicking OK will get you to the following screen.  Provide a valid SharePoint site this solution will be deployed to and choose “Deploy as a sandboxed solution”.

image

5. Click “Next”, browse to the ts.wsp that was downloaded to your local drive.

6. Click “Next”, then “Finish” to import all the contents from the WSP.

7. Browse to your SharePoint site where the solution will be deployed to and click to view all the site content, notice the last modified time stamp.

image

8. From Visual Studio, simply build and deploy this solution [Build menu > Deploy solution].  Check view all site content, specifically the modified date.  Lists would have got recreated with new time stamps, existing data that were in the document library would be deleted.

image

9. If you retract the solution from the Visual Studio project, OOB site columns and content types will be deleted. You can view the site columns and Content types gallery, ALL of the OOB columns and content types got removed.

Redeploy the WSP will add the content types and site columns back.

Note of advice is not to do VS deployment directly on a site collection where there is working data even on a test/development environment unless you are sure about doing this.

Comments
Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment