me

Syndication:


Google
Web manuelfoerster.net

Categories:

  • Blogroll

  • Calendar

    November 2008
    M T W T F S S
    « Jul    
     12
    3456789
    10111213141516
    17181920212223
    24252627282930

    Archives:

    custom activity libraries - compile time validation issue

    April 24th, 2006 by manu

    there is a quite annoying problem with custom activity libraries in beta 2 of the windows workflow foundation.
    compiling activity libraries with ActivityValidators yields errors like Activity ‘foo’ validation failed: Property ‘bar’ is not set.

    according to [1], beta 1 only ran the validators if the activity was part of a workflow. now beta 2 also runs the validators at compile time, which obviously can’t work for properties you just don’t know how to set before design time.
    now you can either see if the activity is actually used in a workflow by simply checking it for a parent before validation:

    if (activity.Parent == null)
    {
            return new ValidationErrorCollection();
    }
    //validation goes here…

    or you make your library an ordinary c# project by removing the

    import Project=”$(MSBuildExtensionsPath)\Microsoft\Windows Workflow Foundation\v3.0\Workflow.Targets”

    tag from your library’s build file.

    [1] msdn wwf forum

    tags:

    , , , , ,

    Posted in windows workflow foundation | | del.icio.us digg

    Leave a Comment

    Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.