Sunday, February 25, 2007

SharePoint Workflow Project Template Problems

If you’re using the SharePoint Workflow templates you may want to make one change to the PostBuildActions.bat file.  Currently the batch file deletes the old feature, copies over the new bits, and then deactivates and uninstalls the feature.  This can leave you with orphaned bits and pieces around if you’ve been doing things like renaming or removing content types, InfoPath forms, etc.  You’re hosed because the batch file, as is, doesn’t get rid of the old bits on SharePoint before killing things off the file system.  Not good.

Here’s a suggestion (which it should be noted I’ve not actually tested yet…):  Alter the PostBuildActions.bat file in the project template files, located normally in C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ProjectTemplates\CSharp\SharePoint.  Open up the seqcs.zip and smcs.zip files therein, extract and edit the aforementioned batch file, then add it back to the template zip files.

You’ll need to grab the lines

ECHO.
ECHO Deactiviating and uninstalling the feature...
ECHO.

%STSADM% -o deactivatefeature -filename %PROJECTNAME%\feature.xml -url http://localhost
%STSADM% -o uninstallfeature  -filename %PROJECTNAME%\feature.xml

and move them up above the lines in the section “Deploying the feature:“.

1 comment:

Dave O'Hara said...

We discovered this one the hard way - any recommendations on scrubbing the orphaned bits (form templates that won't delete)??

Subscribe (RSS)

The Leadership Journey