Step 3. Select the project template of Activity Library and enter the name as CustomActivity and click the Ok button. Ensure that Add to Source Control option is checked

Make sure to specify the location in Iteration 2 in Development branch

Step 4. Add Code Activity to the project

Step 5. Right click on the project in Solution Explorer and select properties. Change the target framework from client to full.

Click on the Yes button.

Step 6. Add references to following assemblies

Select the project template of Activity Library and enter the name as CustomActivity and click the Ok button. Ensure that option is checked Make sure to specify the location in Iteration 2 in Development branch Add Code Activity to the project Right click on the project in Solution Explorer and select properties. Change the target framework from client to full.Click on the Yes button. Add references to following assemblies

Step 11. Ensure that the Items to build dialog box contains both the solutions for custom Activity and Tailspin Toys, as shown below

Step 12. Remove any automated tests to be executed on Build. In the process tab, select automated test and click on the Remove button. Click OK.

Step 13. Create a copy of the default template and name it as “InvokeProcessBuildProcessTemplate.xaml”

Make sure that the items to build has the selected custom activity, as well as the tailspin toys solution. Also make sure that no automated tests are to be executed as BVT. Save the build definition.

Step 14. Create a branch for InvokeProcessBuildProcessTemplate.xaml in the following manner as shown below, by using the Source Control Explorer.

Ensure the target folder is pointing to CustomActivity.

Step 15. Let us now create a console application which will be invoked using Invoke Process Activity. Right click on the solution in Solution Explorer and select the option of Add New Project. Select the project type as Console Application and provide name as ConsoleAppCreateFile

For Custom Activity add references to System.Activities.Presentation, PresentationFramework and WindowsBase. Close InvokeProcess.xaml file and Build the custom activity project. In case you get an error for the .dll file, right click on the file and specify Check out for edit.

Step 20. Right click on CustomActivity and select the Add Existing Item and add the branched xaml file. Set the Build Action as None for this file.

Step 21. Open the file, collapse the sequence and add the InvokeProcess activity as follows

Save and close the file.

Step 22. Right click on the file in solution explorer and select View Code. Change local to ssgs.

Also change local to ssgs where InvokeProcess appears.

Step 23. Close and save the file. Check in the branch, merge to its original and check in.

Step 24. Ensure that the CustomAssembly.dll is also checked in. Right click on Builds from Team Explorer. Specify the custom assembly path as follows

Step 25. Right click on the build and select queue new build. After successful execution of the build, the txt file gets created on C drive and the log shows execution of invoke process as follows.

That’s it! These were the steps to call an activity Invoke Process by customizing the process template in Visual Studio 2010.

Was this article worth reading? Share it with fellow developers too. Thanks!

Gouri Sohoni is a Trainer and Consultant for over two decades. She specializes in Visual Studio - Application Lifecycle Management (ALM) and Team Foundation Server (TFS). She is a Microsoft MVP in VS ALM, MCSD (VS ALM) and has conducted several corporate trainings and consulting assignments. She has also created various products that extend the capability of Team Foundation Server.

Feedback - Leave us some adulation, criticism and everything in between!