locked
How to use a custom expression language instead of VB expressions? RRS feed

  • Question

  • There have been some previous posts asking about how to use an expression language other than VB in WF 4.  However, there don't seem to be any clear answers on how to go about doing this.  Does anyone have any concrete information on this topic?

    Thanks

    Friday, November 6, 2009 10:52 PM

Answers

  • The support for expressions in a language other than VB is not going to make it in .NET 4.0. This is one of the reasons CustomLanguage* has been removed. We're looking at enabling that support in the release after .NET 4.0.
    Thanks,
    Kavita


    Senior Lead Program Manager, Windows Workflow Foundation http://blogs.msdn.com/kavitak
    Friday, November 13, 2009 6:41 PM

All replies

  • Hi WN,
    According to me, there's no way to use another expression language. The Vb expression style is required because the VB compiler is used in background. May be a someone else could explain what's the special required feature that vb compiler have that the c# compiler doesn't have.



    Karol Deland, Québec
    Sunday, November 8, 2009 4:32 AM
  • Expressions in the Workflow designer are in VB only for the Visual Studio 2010 release. We chose VB because it has in-memory compilation support and C# does not.

    Thanks,
    Scott
    MS Developer Support
    Monday, November 9, 2009 8:18 PM
  • But the original question is still unanswered.  How does one go about using a custom expression language in WF 4, instead of using VB?  What needs to be added, changed, or replaced?

    Thanks
    Monday, November 9, 2009 9:10 PM
  • I'm not officially recommending this, or saying that this is a supported scenario, but it may be possible by converting to/from an activity tree (of activities in System.Activities.Expressions).
    As far as I know nobody has tried doing it this way yet.

    Tim

    • Proposed as answer by Scott Mason - MSFT Friday, November 13, 2009 12:24 AM
    • Unproposed as answer by W_N Friday, November 13, 2009 2:14 AM
    Thursday, November 12, 2009 11:13 PM
  • There have been prior posts, such as this one http://social.msdn.microsoft.com/Forums/en-US/wfprerelease/thread/e96192d2-53c6-482e-942e-9a87824acffa that suggests it is possible to use a custom expression language.  However, the classes mentioned in that post (CustomLanguageValue and CustomLanguageReference) do not exist in Beta 2.  Furthermore, it seems that the VisualBasicValue and VisualBasicReference classes have all sorts of direct dependencies on internal classes and internal methods in the System.Activities.dll assembly in order to perform tasks that are not possible using just public classes and methods.

    It would be very helpful if there was even a simple example of using a custom expression language.

    Thanks
    Friday, November 13, 2009 2:13 AM
  • The support for expressions in a language other than VB is not going to make it in .NET 4.0. This is one of the reasons CustomLanguage* has been removed. We're looking at enabling that support in the release after .NET 4.0.
    Thanks,
    Kavita


    Senior Lead Program Manager, Windows Workflow Foundation http://blogs.msdn.com/kavitak
    Friday, November 13, 2009 6:41 PM
  • I have to correct myself. While we cut support for directly extending at the same layer that we have our VB support, if you really really wanted a custom language, you can write a compiler that generates VB from your custom language and plug in that way. This post http://social.msdn.microsoft.com/Forums/en-US/wfprerelease/thread/27a0ad73-d212-4680-91c1-d2eaf5cb08bb explains how you can have language extensibility in the designer. In the runtime though all we know is VB or you could use activities directly (expression activities, or ExpressionServices).

    Thanks,
    Kavita
    Senior Lead Program Manager, Windows Workflow Foundation http://blogs.msdn.com/kavitak
    Friday, November 13, 2009 7:32 PM