Wednesday, September 28, 2011

How to remove a SharePoint solution that is giving an error

A while back I had a solution that would just not be removed. In the Solution Management screen in Central Administration, the Status for the solution was a bright red "Error". Attempting to remove it from there would give an error.

Luckily, I found a great post by Alex Thissen that clearly explains how to use stsadm to remove a malfunctioning solution. The blog post is called Remove malfunctioning Windows SharePoint Services solutions.

In a nutshell, if retracting the solution:

stsadm -o retractsolution -name solutionname.wsp -immediate

doesn't work, and if deleting the solution:

stsadm -o deletesolution -name solutionname.wsp -override

doesn't work, then

1. run an enumeration to see the scheduled deployments

stsadm -o enumdeployments

2. use the JobId to cancel the deployment

stsadm -o canceldeployment -id 2529c788-971c-46a3-b69f-a2a0a1fcc851


Afterwards, you can verify it by doing 1. again.

Thursday, September 22, 2011

How to start a SharePoint State Machine workflow without association or initiation forms

This assumes you are creating a SharePoint 2007 state machine workflow in Visual Studio.

If you ever need a workflow to start, but don't want it to have an association or initiation form, you have to do two things, both of which are in workflow.xml:

1. In the Workflow element, do not specify an AssociationUrl (for the association form) or InstantiationUrl (for the initiation form). Just leave it out of the element completely! You may want to do the same thing if you have no modification form.
The attributes indicate the web forms that will host the association and initiation forms. By default, they look like AssociationUrl="_layouts/CstWrkflIP.aspx" and InstantiationUrl="_layouts/IniWrkflIP.aspx".


2. In the MetaData element, be sure Association_FormURN and Instantiation_FormURN are commented out.