none
Generate task-based operations from WSDL causes CS0111 Type already defines a member called xxx with same parameter types RRS feed

  • Question

  • Hello.  When I add a Service Reference to a WSDL it generates a CS0111 Type already defines member error if the "Generate task-based operations" is checked.

    If I uncheck "Allow generation of asynchronous operations" it works fine. 

    Or, if I click the "Generate asynchronous operations" it works fine.

    Is the reason I'm getting the error because the WSDL already defines asynchronous operations?

    And, since the WSDL already defines async operations should I uncheck the "Allow generation of asynchronous operations"?  Or, should I check the "Generate asynchronous operations" button?

    Thanks much!!!

    Thursday, January 24, 2019 7:01 PM

Answers

  • Hi Hiline1961,

    Generate task-based operation is default behavior since the .net 4.5 async/await also based on the Task state machine.
    The WCF 4.0+ generate the task-based operation by default. there is no need to change it to asynchronous operation. In case an error occurs in generating an asynchronous operation, you can try deleting and adding service reference again.

    Best Regard
    Abraham

     
    • Marked as answer by Hiline1961 Tuesday, January 29, 2019 3:25 PM
    Tuesday, January 29, 2019 7:37 AM
    Moderator

All replies

  • Hi Hiline1961,

    Generate task-based operation is default behavior since the .net 4.5 async/await also based on the Task state machine.
    The WCF 4.0+ generate the task-based operation by default. there is no need to change it to asynchronous operation. In case an error occurs in generating an asynchronous operation, you can try deleting and adding service reference again.

    Best Regard
    Abraham

     
    • Marked as answer by Hiline1961 Tuesday, January 29, 2019 3:25 PM
    Tuesday, January 29, 2019 7:37 AM
    Moderator
  • Yes, if I unchecked the "Allow generation of asynchronous operations" then the error went away.

    Thank you, Abraham.

    Tuesday, January 29, 2019 3:25 PM