Team System Developer Center > Visual Studio Team System Forums > Visual Studio Team System 2010 Beta2 > What is the secret to getting a workflow custom activity in to the toolbox?
Ask a questionAsk a question
 

AnswerWhat is the secret to getting a workflow custom activity in to the toolbox?

  • Thursday, July 16, 2009 1:50 PMctor Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I was following the example that Aaaron Hallberg discusses in his blog at http://blogs.msdn.com/aaronhallberg/archive/2009/06/01/writing-custom-activities-for-tfs-build-2010-beta-1.aspx with the idea that I could use the custom activity in a modification to the build process file (Windows Workflow XAML) that is used in a build definition. Creating the custom activity worked. However, I have not found a way to get the custom activity to show up in the toolbox so I could drag it in to the build process file.

    The first attempt was to open the XAML build process file in the designer and right-click --> Choose Items... in the Toolbox window. Browsing in the Activites tab to the SayHello.dll yielded a message box with this message:

    System.Exception: The are no components in 'C:\scm2010\Development\SayHello\bin\Debug\SayHello.dll' that can be placed on the toolbox.

    The SyaHello.dll was derived from compiling the workflow example in the VS 2010 Training kit, specifically the IntroToWF example lab and code (HELLOWORKFLOW, The lab is excellent -- easy to follow and simple). In that example code, the custom workflow shows up in the toolbox when opening the SayHello.xaml file in the designer.

    The second attempt, a work-around, failed as well. The idea was to include the XAML build process file in the HELLOWORKFLOW sayhello project because the SayHellow custom activity was in the toolbox already. I found two potential issues:

    1) The attribute line <SubType>Designer</SubType> was missing from the new XamlAppDef section added to the SayHello.csproj project when I added the build process file. The result was that the 'view code' and 'view designer' entries were missing from the righ-click menu.

    2) I got the following error when I compiled the project:
          XC1020: Build error occurred in the XAML MSBuild task: 'The member _UnknownContent has already been written.'

    This is similar to the issue located here:
    http://www.google.com/search?q=XC1020:+Build+error+occurred+in+the+XAML+MSBuild+task:+%27The+member+_UnknownContent+has+already+been+written.%27&hl=en&rls=com.microsoft:en-us&filter=0

    So what is the secret? Is there another way to inject a custom activity in to an existing build process file?
    •  

Answers

  • Tuesday, July 21, 2009 1:13 PMJason Prickett - MSFTMSFTUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    The only way currently to get your activity into the toolbox is to open your custom assembly solution, add the the XAML file to the solution, and open the XAML file from Solution explorer. In this case, you will need to either change the Build action of the XAML file or simply remove it before compiling.

    If that doesn't work, you should be able to simply edit the XAML file in the XML Editor. The syntax is pretty straight forward.

    Thanks,
    Jason

All Replies

  • Tuesday, July 21, 2009 1:13 PMJason Prickett - MSFTMSFTUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    The only way currently to get your activity into the toolbox is to open your custom assembly solution, add the the XAML file to the solution, and open the XAML file from Solution explorer. In this case, you will need to either change the Build action of the XAML file or simply remove it before compiling.

    If that doesn't work, you should be able to simply edit the XAML file in the XML Editor. The syntax is pretty straight forward.

    Thanks,
    Jason
  • Monday, October 19, 2009 5:06 AMCharles SterlingMSFT, OwnerUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Thank you for visiting the Visual Studio 2010 & .NET Framework 4 Beta 1 Forums. 

    We will be closing the Beta1 forums while the Visual Studio development teams get ready for Beta2.   We will be turning the forums back on as soon as Beta2 is available.

    For more information on Visual Studio 2010 Bet2 availability please see: 

    S. Somasegar and Jason Zander’s blogs

    http://blogs.msdn.com/somasegar
    http://blogs.msdn.com/jasonz/

    If your issue has not been resolved in Beta2 please repost your question in the Visual Studio Team System forums at:  http://social.msdn.microsoft.com/Forums/en-US/category/vsts  -we would certainly appreciate it!

    If you have found a bug or would like to file a suggestion for future versions please visit the Microsoft Connect Beta 1 feedback page. https://connect.microsoft.com/VisualStudio/content/content.aspx?ContentID=12362&wa=wsignin1.0

    Thank you for your input into Visual Studio

    Charles Sterling

    Program Manager Visual Studio


    thanks, -Chuck
  • Tuesday, October 27, 2009 8:46 PMersheido Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Can you provide some more clarification regarding your answer?  I am having a ____ of time trying to get my custom activity to show up in the Toolbox, even though I created the Activities project in the same solution.  I'm using Beta 2 now.

    Thanks,
  • Wednesday, October 28, 2009 1:02 PMJason Prickett - MSFTMSFTUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I am not sure how to make the answer more clear. I assume you have a solution open in Visual Studio that builds your custom activity. You need to add the XAML file you want to edit to your solution (you can change the build action of the XAML file on its properties to keep it from building as part of the solution). Double clicking on the XAML file should open it in the Workflow Designer. Since your workflow solution is open the designer is supposed to show all your custom activities in the toolbox. If it isn't then it must be a bug in the WF designer.

    Thanks,
    Jason
  • Monday, November 02, 2009 2:00 PMersheido Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thanks.  This must be a bug in the Beta 2 then.  I do have the entire project in my solution.
  • 9 hours 33 minutes agoCraig Tadlock Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed Answer
    I had this same issue. One word above caused the confusion. You need to add the xaml to the project not the solution.

    More info here...

    http://www.tadlockenterprises.com/2009/11/custom-build-activities-in-tfs-2010/

    CT
    http://www.tadlockenterprises.com