devtrends.com
 

Custom Workflow Actions (Part 3 of 3)

Filed under: SharePoint, Visual Studio — Tags: , — admin @ August 24, 2008 8:25 pm

…this is a continuation of Custom Workflow Actions (Part 2 of 3)

As a recap, we are creating a custom workflow action that allows you to send an email with the attachments from a specified list in your site. The custom workflow action will allow you to configure four user input fields: (a) the Email Content; (b) the Send From Email; (c) the SMTP Host; and (d) the Associated List.

Although this project can be broken down into three sequential steps, these three steps are so closely intertwined that content from all three are required by the other three. With that stated, read all three sections, play around, then begin your actual development. The three steps are:

Step One: Create and Compile your .NET Workflow Activity
Step Two: Modify or Create .ACTIONS file and Add to Authorized Assemblies
Step Three: Deploy to WSS server and GAC

Step Three: Deploy to WSS server and GAC

This step assumes you successfully completed Part 1 of 3 and Part 2 of 3. This Part is considerably shorter than 1 and 2 because you will likely run through the steps in the Part many times as your debug your SharePoint Workflow action DLL.

Copy the Compiled Assembly DLL to WSS

Although some people recommend deploying your DLL to a specific folder under the Windows folder, I recommend for this project and other projects to deploy the DLL into the SharePoint folder structure. Therefore, we will deploy your DLL to the SharePoint folder: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI

Let’s copy the latest compile from your Visual Studio project as was in Part 1 of 3 to the SharePoint folder listed above.

Next, we will need to use the gacutil.exe tool to add the DLL to the GAC cache. Run the following commands from a command prompt at the location of the DLL:

C:\…\web server extensions\12\ISAPI>gacutil /I devtrends.EmailAttachments.dll

You should receive a message similar to: “Assembly successfully added to the cache”

If you received a bad command or filename error, then the gacutil.exe application may not be readily available to the command prompt. The gacutil.exe is a tool that is included with the .NET framework, specifically all .NET frameworks. Depending on the level of .NET framework you wrote the program in, you need that level or higher of the gacutil.exe application. For the purpose of this article, the gacutil.exe version is 3.5, and the gacutil.exe was copied to the C:\…\web server extensions\12\ISAPI folder. You may need to search your computer for the gacutil.exe and copy it to the SharePoint folder that you copied your compiled DLL.

Finally, you will need to restart your Information Information Server, so issue the command iisreset:

C:\…\web server extensions\12\ISAPI>iisreset

Open SharePoint Designer, you should now have the custom action in your list of Workflow actions.

I hope this article was helpful. If you have questions please submit them as a comment.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Blog Categories
  • BlackBerry (1)
  • Group Policy (1)
  • Linux (1)
  • Microsoft Office (1)
  • Networking (1)
  • Printing (3)
  • SharePoint (6)
  • SQL (1)
  • Visual Studio (3)
  • Windows XP (1)

  •