Search code examples
c#.netwindows-runtimeasmx.net-4.5

Web References (ASMX) on WinRT


I'm working on a Windows Store App for Windows 8.1, trying to connect to a Web Service. This Web Service has client implementations for both Web References and Service References. But I'm having trouble to connect using a Service Reference.

I've been using successfully this same web service, by connecting through a Web Reference, but, surprisingly, there's no way to add a Web Reference when using .NET Framework 4.5.1. (There's no compatibility option with the Add Web Reference button like it used to be, inside the Service Reference Advanced Options dialog box).

Since I'm developing for Windows 8.1, i can't target any older version of the .NET Framework. So, is there any way to work with Web References on Windows Store Apps for Windows 8.1? Is it a bug or they just stopped supporting old platforms? Or maybe i'm missing something. I'm working with Visual Studio 2013 Express for Windows, using C#.


Solution

  • Web References (.asmx's) are not supported in Windows Store apps. Sorry, they just aren't. It has nothing to do with .NET 4.5.1, it's a limitation of the WinRT framework. You have to use service references with WCF. If you don't have it, you'll have to write a wrapper service that wraps your asmx to a WCF.

    Even Service references are not 100% supported. This post talks about this more:

    http://blogs.msdn.com/b/piyushjo/archive/2011/10/19/wcf-for-metro-apps-supported-functionality.aspx