locked
How to make the validation Errors as Compilation Errors RRS feed

  • Question

  • Hi

    As part of our Custom Activities, we are adding few validation errors to the Metadata.These errors are appearing in design time under Error List; but still we are able to build the project successfully.

    Our requirement is that, if there is any validation error, it should throw compilation error.

    Looking for some good suggetions to implement this behaviour.

    Thanks

    Ambily


    Assistant Consultant
    Friday, October 8, 2010 7:30 AM

Answers

  • Hi Ambily:
    As I know, there is no way to make the validation errors as compilation error in Visual Studio 2010 RTM now.
    Could you tell me why do you need this feature and what is your target scenario? Is there any other we can have other way do achieve your requirement except making the validation error as complilation errors?

    Hong

    • Marked as answer by Andrew_Zhu Friday, October 15, 2010 6:39 AM
    Saturday, October 9, 2010 2:06 AM

All replies

  • Hi Ambily:
    As I know, there is no way to make the validation errors as compilation error in Visual Studio 2010 RTM now.
    Could you tell me why do you need this feature and what is your target scenario? Is there any other we can have other way do achieve your requirement except making the validation error as complilation errors?

    Hong

    • Marked as answer by Andrew_Zhu Friday, October 15, 2010 6:39 AM
    Saturday, October 9, 2010 2:06 AM
  • Hi Hong

    Thanks for the reply.

    We have a set of custom activities. Right now, we are using RequireArgument attribute and ValidationError to throw the design time exceptions. Now, without fixing the validtion errors, user is able to build the workflow. But, he is getting the runtime error due to missing argument value.

    Now the behaviour is Design time Validation Error -> Compilation Successfull -> Runtime Exception.

    Whether we have any other way to fire design time errors, which will cause compilation errors?

    Regards

    Ambily

     


    Assistant Consultant
    Monday, October 11, 2010 11:40 AM
  • I wasn't able to produce this behavior either. Note that even validation errors in built-in activities don't produce build errors.
    Monday, October 11, 2010 4:11 PM
  • Hi, Ambily

    It seems that WF4 designer is not easy to use for a none-developer user. So, rather than make a big change to the designer itself, a sound solution is delivering a trainning for the WF4 designer users to tell them how to author a correct WF4 workflow.

    Regards
    This posting is provided "AS IS" with no warranties, and confers no rights. Microsoft Online Community Support. My Blog:http://xhinker.com "Microsoft Windows Workflow Foundation 4.0 Cookbook"
    Wednesday, October 13, 2010 7:51 AM
  • In the old version of WF one great functions was that validation errors generated real build errors, this is also a key function for successfull TDD and some checkin-policys.

    http://msdn.microsoft.com/en-us/library/system.workflow.componentmodel.compiler.activityvalidator.validate(v=VS.85).aspx


    http://workflowfoundation.blogspot.com
    Wednesday, March 16, 2011 8:33 AM