I am trying to deploy an alpha version of the project I'm working on and I'm running into some issues that are likely because I have a flawed understanding of how to do deployments.

My site is fairly simple. On my development machine I customized some lists and added a CustomAction to one of them that takes you to a custom aspx.

I'm running into issues when I try to deploy this to the test environment. Here are some things I've tried and the issues I've had:

1) I tried saving my site as a template and then uploading it from the sharepoint web ui.

Problem:  The custom action doesn't seem to go along with the WSP and 
so I get an error saying that I cannot create a site from the template 
because of a missing feature.

2) I then tried using powershell which let me successfully install & add the solution.

Problem: This did not make my solution available to create sites from.  
That option seems to only be available when you upload them from the web ui.

3) Here is where it gets murky... through some combination of playing around in powershell and the web ui i managed to get my feature to show up in the features list, but my custom action didn't work because i was using a specific list id for it and the new site i created had a different list Id

4) I generalized my custom action by list type which worked in dev. I then attempted to remove all the solutions I tried.

Problem: A few of these cannot be removed and give a generic error message.

5) I moved my custom action to a separate project and deployed it with powershell. Then I deployed the project containing the aspx page with powershell. Then i saved my dev site as a template and uploaded it to test, then created a new site based on the template.

So now that I've given all my background, here are my questions:

Q1: Is #5 the right way to deploy this? Is it possible to group all this up in one deployment?

Q2: Do you have any suggestions for organizing my project more effectively? This is my first time dealing with SharePoint and this thing is only going to grow. Having a simple deployment process is important to me because I know that even simple processes can be a pain to get installed when dealing with admins who are not on the project.

Q3: How can I clean up the failed deployments I tried? Am I stuck with them forever?

Thanks for your time!

Edit: I broke Q3 (how do I clean up failed deployments?) into a separate question: Cannot Uninstall UserSolution: non-existent or broken web

Edit: I was finally able to deploy the solution by following these steps:

  1. In VS I retracted all of my code.
  2. In my local environment I packaged the site into a WSP
  3. I uploaded my wsp to the test site and activated it, then created a site from the template.
  4. I deployed the two wsp's that contained my code.
  5. I activated the feature for my custom action.

It seems like Louis is suggesting that I create a template for my site once and then work with it in visual studio.

  • What version of SharePoint is this? 2007 or 2010?
    – user2536
    Commented Mar 12, 2012 at 21:58
  • This is Sharepoint 2010
    – samspot
    Commented Mar 19, 2012 at 15:26

1 Answer 1


How did you add the CustomAction? Through SharePoint Designer or in Visual Studio?

If it's through SPD, there cannot be any missing features (problem #1), because none existed in the first place to go missing. I'm not sure if CustomAction go along with site templates but if they don't your new site from the template will just not have the action, without complaining.

If it is through Visual Studio, that is indeed a feature dependency. You need to redeploy your feature on the new web application (if it's a different one), but SharePoint should be able to activate it on a new site.

There is no deployment dependency between CustomAction, their target URLs (pages), and the item type to which they are attached. Meaning, you can deploy any of those items even if the others are not there. SharePoint does not check if your CustomAction is for an existing list or points to a valid page.

The best practice to ensure maximum compatibility and ease of maintenance is to package site templates and custom actions in a WSP with Visual Studio. Site Templates are just a poor cousin to proper site definition and if you want to evolve your site you will eventually hit a wall.

To remove your stuck features, try using the -force argument (it exists in most of the add/activate/de-activate/remove commands in both STSADM and Powershell)

  • Hey Louis thank you for the help. I'm going to post a separate question about removing the old solutions for now, after working that out I'll come back to my question here. Thanks!
    – samspot
    Commented Mar 16, 2012 at 23:02
  • So I should save my site as a template initially and from then on work with it inside visual studio?
    – samspot
    Commented Mar 19, 2012 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.