Building a simple workflow with Visual Studio 2005 in SharePoint

Create a new SharePoint Sequential Workflow project.

Drag and drop SendEmail activity just after onWorkflowActivated1 activity .

Set CorrelationToken property of SendEmail to workflowToken which is the workflow correlation token used by onWorkflowActivated1.

For MethodInvoking set the value sendEmail1_MethodInvoking and click which would generate the handler.

private void sendEmail1_MethodInvoking(object sender, EventArgs e)


sendEmail1.To = “”;

sendEmail1.From = ” “;

sendEmail1.CC = ” “;

sendEmail1.Subject = “MySubject”;

sendEmail1.Body = ” This is test mail”;



Strong sign the assembly and install it in GAC.

Set your feature.xml as following

<Feature Id=23CB845A-7204-4d41-9873-FE50BEB78BCD

Title=Default Title

Description=This feature is a workflow that …





<ElementManifest Location=workflow.xml />



Id– Provide a new guid for uniquely identifying the feature

Title – to be displayed in the list of features deployed to the site

Description – Any description that appears beneath the Title.

Location – Leave it to default as the directory is same.

Set your workflow.xml as following

<Elements xmlns=>


Name=My Workflow

Description=This workflow …



CodeBesideAssembly=SharePointWorkflowLibrary3, Version=, Culture=neutral, PublicKeyToken=58efe34bdb2df93e








Name – Name of the workflow.

Description – Any description about the workflow

Id – A new guid for the workflow

CodeBesideClass – Namespace.ClassName

CodeBesideAssembly – name of assembly, version , culture and publicKeyToken which we can get by right clicking the assembly in gac and selecting properties.

Remove all other entries as we are not using any forms for this workflow.

Now modify the install.bat file as mentioned in the instruction for the same.

Run install.bat

Next go to the site where the new workflow has been deployed.

Select any document library – than settings- document library settings – workflow settings – add a workflow.

We’ll see our workflow within the workflow template.

Correlation Token – A correlation token is essentially a means of uniquely identityfing each instance of a workflow, modification or task.


Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

Share your thoughts

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.