I am trying to figured it out, but have no success for now. Is it possible to use async/await in webmethod asmx service ? What I found till now is that async/await can be used only in WCF service method (rest or whatever).
Asked
Active
Viewed 8,628 times
8

John Saunders
- 160,644
- 26
- 247
- 397

Nikola Yankov
- 1,264
- 1
- 15
- 28
-
3WCF was released in 2006 as a recommended replacement for asmx. Asmx was officially declared a "legacy technology" in 2009. If you're planning to change the code anyway to make it `async`, why not change it to a newer platform? – Stephen Cleary Jun 26 '12 at 18:09
-
In general, you should not expect ASMX to keep up with modern technology. It is legacy software, kept around for backwards compatibility. Consider the following question: why should Microsoft has spent money testing `async`/`await` on ASMX services? – John Saunders Jun 26 '12 at 20:21
-
Stephen, John, thank you for your comments. I guess I should go in direction to migrate my existing asmx service to wcf. – Nikola Yankov Jun 27 '12 at 08:58
-
John, you marked the question as duplicated, but the question you marked as source is asked more than one year after this question. – Nikola Yankov May 15 '14 at 12:26
1 Answers
3
This is a bad idea. You're basically trying to use a modern language feature with a legacy technology - when .asmx was introduced the notion of asynchronous services wasn't really established.
An answer may lie here though:
Is there some way to handle async/await behind an ASMX service?
I'd say stick to WCF or WebAPI.