none
Designer Error when redendering Workflows RRS feed

  • Question

  • I'm periodicly getting the follow error when loading my Workflow Speech Apps.

     

    Error Loading Workflow

    An error occured while loading the workflow. Please correct the error and try reloading the document to view the workflow.

    The variable 'getPhoneToDNC' is either undeclared or was never assigned.

     

    When I comment out the below lines in the myapp.designer.vb file I'm able to view and modify the workflow in the designer. 

    AddHandler getPhoneToDNC_Accept_DtmfGrammar.Recognized, AddressOf Me.getPhoneToDNC.Accept

    AddHandler getPhoneToDNC_Deny_DtmfGrammar.Recognized, AddressOf Me.getPhoneToDNC.Deny

    What I've been doing is commenting out these lines so I can view and modify the WF, and then uncommenting them before building the procject.

     

    I initially thought it was just my app but I just noticed I'm getting the same type of behavior on the RecordMessage Sample.

     

    Sounds like some type of WF designer problem.

     

    Any Ideas, I'm I missing a patch?

    Thursday, June 28, 2007 8:37 PM

Answers

  • Hi Angel,

    It does appear to me to be something with the WF designer. I'm not aware of a patch for it.

    This problem appears to be happening on the "second" AddHandler call when resolving the AddressOf part (although it strangely doesn't have a problem with the first one.) when loading into the designer surface (for example when choosing "view designer" on your application code.)

     

    I did find a workaround for this issue if you don't regenerate that section of code. (Re-running the code that generates this will replace it back.) This will help prevent you from having to comment/uncomment at least between builds.

     

    -Walter

     

    Here's an example of how to do it:

    1) open up the *designer.vb file

    2) Create a Delegate called "MyDelegate" add this line above the class declarations (like under the imports section)

            Delegate Sub MyDelegate(ByVal sender As Object, ByVal e As Microsoft.SpeechServer.Recognition.RecognizedEventArgs)

     

    3) Then use the Delegate for the AddressOf sections of the AddHandler calls.

     

            'ACCEPT PART

      Me.getPhoneToDNC.ConfirmationGrammars.Add(getPhoneToDNC_Accept_DtmfGrammar)

            Dim myac As MyDelegate

            myac = AddressOf Me.getPhoneToDNC.Accept

            AddHandler getPhoneToDNC_Accept_DtmfGrammar.Recognized, AddressOf myac.Invoke

     

            'DENY PART

            Me.getPhoneToDNC.ConfirmationGrammars.Add(getPhoneToDNC_Deny_DtmfGrammar)

            Dim mydc As MyDelegate

            mydc = AddressOf Me.getPhoneToDNC.Deny

            AddHandler getPhoneToDNC_Deny_DtmfGrammar.Recognized, AddressOf mydc.Invoke

     

     

    Wednesday, July 18, 2007 11:32 PM

All replies

  • Can you provide some more details? Where are these lines of code? What is the full body of the exception you see (and is there a stack trace)?

     

    When you say you get the error when "loading", do you mean when trying to open the workflow in the designer view (as opposed to when you actually run the app)?

     

    From the error, it sounds like you've put those lines of code (which try to wire up event handlers, I assume, even given my pathetic knowledge of VB.Net) at some point in your app prior to when "getPhoneToDNC" is instantiated.

     

    Dan

     

    Friday, June 29, 2007 1:17 AM
  • The lines of code appear In the InitializeComponent Method in the myApp.designer.vb file

    The error is occuring in the WF designer view. The app runs fine after uncommenting the lines and building.

     

    The code to instantiate getPhoneToDNC is in the InitializeComponent method and appears way before any referances to it.

    Me.getPhoneToDNC = New Microsoft.SpeechServer.Dialog.GetAndConfirmActivity

     

    Also note that this is the designer generated code, I'm only altering it to comment out the lines that are causing the WF not to load.

     

    I think it maybe a problem in the WF designer but I'm supprised other are not running into it.

     

    As I said before I'm getting the same type of behavior with a few of the sample problems as well.

    Friday, June 29, 2007 7:01 PM
  • Hi Angel,

    Can you let us know the status of your problem?

    Friday, July 13, 2007 10:03 PM
  • I'm still getting the condition.

    I setup a new server thinking I may have installed something incorrectly but I'm getting the error on that server as well.

     

     

    Tuesday, July 17, 2007 6:27 PM
  • Hi Angel,

    It does appear to me to be something with the WF designer. I'm not aware of a patch for it.

    This problem appears to be happening on the "second" AddHandler call when resolving the AddressOf part (although it strangely doesn't have a problem with the first one.) when loading into the designer surface (for example when choosing "view designer" on your application code.)

     

    I did find a workaround for this issue if you don't regenerate that section of code. (Re-running the code that generates this will replace it back.) This will help prevent you from having to comment/uncomment at least between builds.

     

    -Walter

     

    Here's an example of how to do it:

    1) open up the *designer.vb file

    2) Create a Delegate called "MyDelegate" add this line above the class declarations (like under the imports section)

            Delegate Sub MyDelegate(ByVal sender As Object, ByVal e As Microsoft.SpeechServer.Recognition.RecognizedEventArgs)

     

    3) Then use the Delegate for the AddressOf sections of the AddHandler calls.

     

            'ACCEPT PART

      Me.getPhoneToDNC.ConfirmationGrammars.Add(getPhoneToDNC_Accept_DtmfGrammar)

            Dim myac As MyDelegate

            myac = AddressOf Me.getPhoneToDNC.Accept

            AddHandler getPhoneToDNC_Accept_DtmfGrammar.Recognized, AddressOf myac.Invoke

     

            'DENY PART

            Me.getPhoneToDNC.ConfirmationGrammars.Add(getPhoneToDNC_Deny_DtmfGrammar)

            Dim mydc As MyDelegate

            mydc = AddressOf Me.getPhoneToDNC.Deny

            AddHandler getPhoneToDNC_Deny_DtmfGrammar.Recognized, AddressOf mydc.Invoke

     

     

    Wednesday, July 18, 2007 11:32 PM