- I Opened my .net 2.0 ASMX webservice in VS2010 and migrated to .net4.0. If i simply run my ASMX w/o changing te code to WCF format i can still run old asmx service under .net 4.0 ?? will this work as it is?
- My web.config file also has WSE settings what happens to this?
- WCF/net4.0 does not support attachments, do i need to change my asmx webmethod to return as dataset in the body and will this work?
- I tried running my existing asmx service using dataset as attachments in .net 4.0 and it worked?
- I can see asmx file can be added in the .net 2010? are they still supported?
-
Why is #4 even a question? "I tried something and it worked" is a statement. Why is #5 a question? If you can add them in .Net 2010, yes, they are supported. – Feb 03 '11 at 15:23
-
@ Yodaj007, .net 4.0 has replaced WS/WSE to WCF, this means to me no asmx and no attachements (i might be getting it wrong). But .net2.0 VS2005 project once migrated to VS2010 .net4.0 works as it is(which uses WSE and attachments) this is what is confusing – Gauls Feb 03 '11 at 15:38
-
"Attachments" are supported by almost nobody today. Instead, use MTOM, which WCF does support. – John Saunders Feb 04 '11 at 02:28
3 Answers
Yes, you can use ASMX in .NET 4.0 also.
Quoting Dave Ward from his reply to a comment on his post at Encosia named ASMX and JSON – Common mistakes and misconceptions
I think WCF is great in situations where you can take advantage of its strengths, like when you can use the tcpBinding mode. However, WCF’s complexity makes it hard to seriously consider for simple AJAX callback functionality where a better targeted, more mature solution already exists.
ASMX is by no means deprecated or obsolete, even in .NET 4. That’s actually one of the misconceptions I’m going to cover in this series.
-
does that mean i can continue using my existing ASMX files as it is passing datasets as attachments, so far i cannot get any error on my dev box. am i missing something?? – Gauls Feb 03 '11 at 16:10
-
Mr. Ward must not have tried creating a WCF service with .NET 4.0 if he calls it complex. Rather, the flexibility is hidden until you need to use it. – John Saunders Apr 17 '14 at 23:17
-
@JohnSaunders: :) have to agree WCF is pretty complicated compared to ASMX. but immensely powerful – naveen Apr 18 '14 at 04:47
-
"complicated", or "full of features"? How easy is it to create a "Hello, WCF" service, vs how easy is it to do the same with ASMX? – John Saunders Apr 18 '14 at 08:40
-
Is this still true in 2019? I specifically refer to "ASMX is by no means deprecated or obsolete" – andreapier Apr 16 '19 at 11:02
-
@andreapier "Microsoft have not officially deprecated WCF or ASMX, or made either obsolete. You can still add both using the latest version of Visual Studio." (https://forums.asp.net/post/6249811.aspx) BUT on the other hand, ASMX Web services depend on .Net Framework 4.5 and "As previously announced, starting January 12, 2016 Microsoft will no longer provide security updates, technical support or hotfixes for .NET 4, 4.5, and 4.5.1 frameworks" (https://devblogs.microsoft.com/dotnet/support-ending-for-the-net-framework-4-4-5-and-4-5-1/) – Göran Roseen Oct 04 '19 at 13:10
-
1Currently Microsoft recommends to use gRPC (protobuff) instead of ASMX or WCF – rfcdejong Nov 27 '20 at 15:28
ASMX Web Services would fall under the .NET framework lifecycle. The .NET framework 4.0 and 4.5 support ASMX web services. Microsoft recomends that no new code be created using ASMX as pointed in the earlier answers.

- 942
- 8
- 13
To quote Microsoft:
This topic is specific to a legacy technology. XML Web services and XML Web service clients should now be created using Windows Communication Foundation.
Decide on your own what that means to you.
WCF completely replaces ASMX web services. People who complain about the complexity of WCF aren't paying attention. Go create a new WCF service and look at the actual code in the "hello world" service that the template creates. That's only more complicated than what the ASMX template created because it includes two operations not just one.
Make no mistake about WSE, however. It's simply obsolete. Stop using it as soon as possible, and do not develop any new code using WSE.
Don't let anybody convince you that nothing has changed. It has. ASMX has been replaced by something much better, much more powerful, and much more flexible.

- 160,644
- 26
- 247
- 397
-
Thanks for replying, so far i have concluded .net 4.0 has introduced all in one framework WCF replacing messaging,remoting,asmx WS,WSE) but for backward compatibility it still supports ASMX WS/WSE (based on my testing so far). Please correct me if i am wrong. This is very important as my existing project(.net 2.0) migrated to .net4.0 and works as it is w/ extra settings in config supportruntime. ne new development will use WCF for sure ,but for now i will be happy if my existing code works either in .net 2.0(dll & WS) running in .net 4.0 CLR (which failed so far) or .net 4.0 – Gauls Feb 06 '11 at 10:30
-
1"People who complain about the complexity of WCF aren't paying attention." Read the post marked as answered above. – Karlth May 14 '20 at 12:18
-
1@karith it's pretty easy to use WCF and "Add Service Reference" to access a simple SOAP service over http or https. Also very easy to create such a service in WCF, as the defaults take care of the configuration for you. – John Saunders May 14 '20 at 19:43
-
@Karlth I think the trade-off to grasping a slightly more complex service platform technology now, vs. being stuck with an obsolete, outdated and unsupported platform a year from now are clear. Besides, that was from 2011. WCF has simplified the process of creating service and client. – TSmith May 28 '20 at 20:22
-
@TSmith I think it is a question of what you are comfortable with. If you use ASMX Web Services and they work it is better to continue using them and spend your time on actually solving the problem your software was meant to solve - instead of spending time chasing the new thing. The user won't care and 99.9% of the time it won't matter technically either. – Karlth May 30 '20 at 14:50
-
1@Karlth No. it's not better to continue to use ASMX just because you're "comfortable". Why doesn't everyone just stay on .Net 1.0 if they're "comfy". WCF is not a shiny new thing. It's been around for 14 yrs (at time of post it was already 5yrs old). WSE has been marked obsolete by MS(hasn't received updates in 9 years). MS states if you need to build a SOAP based service and you're on .Net 3.0 or greater, DO NOT USE ASMX, use WCF. Your ASMX service platform will fall behind, exposing security risks, it will not be able to support changes with the technology landscape of web services. – TSmith Jun 01 '20 at 01:43
-
@TSmith ASMX web services are not obsolete. They are offered as an option when consuming web services. Microsoft recommending that web services be consumed using the newest library is common practice and does not mean in itself a different library is obsolete. If ASMX web services work for you please continue using them, I know I am. – Karlth Jun 02 '20 at 09:57
-
@Karlth "Obsolete" doesn't mean it no longer exists. It means bugs aren't going to be fixed. It means don't use it if you intend your software to live a long, productive life. Besides, "Add Service Reference" doesn't care what kind of SOAP web service you're consuming. It might not even be a .NET web service. It doesn't matter, from a client point of view, whether or not you are consuming an ASMX service. – John Saunders Jun 03 '20 at 10:11
-
@JohnSaunders Correct on both counts but mature libraries can "live a long productive life" even though they are no longer updated. – Karlth Jun 04 '20 at 11:16
-
@Karlth except that security bugs will not be fixed. If you want to keep using code that has vulnerabilities that will never be fixed, go for it. – John Saunders Aug 08 '20 at 05:22
-
@JohnSaunders I sure will while someone else can continue running after the latest package from Microsoft which contains much more dangerous security holes and will of course eventually be replaced by something shiny later. Meanwhile I'll continue coding. – Karlth Sep 10 '20 at 22:25
-
@Karlth this "latest package" is over a decade old. WCF is no longer new. Also, even if "the latest package" had horrible security bugs, the difference is that the "bad guys" know the old security bugs and exploits already. At least with the "latest package", they need to find the new vulnerabilities. – John Saunders Nov 19 '20 at 02:50