问题
I recently just published a small collection of WCF services. When I went into my UWP app to add references I only see the option to generate task based operations. I am a fan of async operations, I also remember this being a feature previously so what is the deal?
Screenshot of the section:
回答1:
Probably need to clear up a little terminology here. The "asynchronous operations" option that is grayed out refers to the Asychronous Programming Pattern (i.e. BeginXXX, EndXXX methods) where as "task-based operations" refer to the Task-based Asynchronous Pattern (TAP) with which you can async/await.
Both are forms of asynchronous operation so it is unclear which you refer to when you say "I am a fan of async operations". I imagine you want to use the async/await keywords so the "task based operations" option is actually the one you want to use.
来源:https://stackoverflow.com/questions/40201251/uwp-service-reference-generate-task-based-operations-is-the-only-option