UWP Service Reference - Generate Task based operations is the only option

好久不见. 提交于 2020-01-06 16:03:15

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!