Asynch operation exception

Discussion in 'CRM / Helpdesk / App Integration' started by SWSDEV, May 3, 2010.

Thread Status:
Not open for further replies.
  1. SWSDEV

    SWSDEV Member

    Joined:
    Feb 23, 2008
    Messages:
    256
    Likes Received:
    0
    I am getting this exception when trying to start an external code component.

    This error is from the asp .net page having an issue and not the code component. But they could be linked I'm sure, have you guys run into this before?

    Exception has been thrown by the target of an invocation. --> Asynchronous operations are not allowed in this context. Page starting an asynchronous operation has to have the Async attribute set to true and an asynchronous operation can only be started on a page prior to PreRenderComplete event.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. VAD_Support

    VAD_Support Active Member

    Joined:
    Aug 6, 2009
    Messages:
    690
    Likes Received:
    0
    Hi,

    I never saw this behavior. What is the DLL doing? Are you launching some task in backgrund?

    Thanks,
     
  3. SWSDEV

    SWSDEV Member

    Joined:
    Feb 23, 2008
    Messages:
    256
    Likes Received:
    0
    I am using the Speech API classes.

    SpeechSynthesizer speaker = new SpeechSynthesizer();

    Although I'm not 100% sure that is the cause, but that's the difference between everything else we've done.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. VAD_Support

    VAD_Support Active Member

    Joined:
    Aug 6, 2009
    Messages:
    690
    Likes Received:
    0
    Maybe that class triggers som task in background, not sure, I never used it.

    Are you planning to generate TTS with that API? And stream it using the VAD? Maybe an option could be generate it in a separated process, and use an External Code Execution Component to communicate with it.
     
  5. SWSDEV

    SWSDEV Member

    Joined:
    Feb 23, 2008
    Messages:
    256
    Likes Received:
    0
    Yes I am using TTS. Using the code component to talk to the Microsoft library.

    I'd like to avoid threading, because then when the VAD gets to the playback step there's no guarantee that the audio file will be ready for playback.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. SWSDEV

    SWSDEV Member

    Joined:
    Feb 23, 2008
    Messages:
    256
    Likes Received:
    0
    Upon debugging the IIS worker process, the exact function it throws the exception on is

    speaker.SetOutputToWaveFile(filename);

    I tried setting Async="true" on the asp .net file, but that didn't help.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. VAD_Support

    VAD_Support Active Member

    Joined:
    Aug 6, 2009
    Messages:
    690
    Likes Received:
    0
    Something you may try is creating a separated process or web service to do the TTS task. Then you can connect with it using an External Code Execution or Web Services Interaction component, and wait there until the task is completed. That way the async operation will be out of the IIS process, and you should not have this problem.
     
Thread Status:
Not open for further replies.