VISUAL STUDIO 2012 WINDOWS PHONE 8 WCF - SYSTEM.SERVICEMODEL.COMMUNICATIONEXCEPTION

ben reitman

Total Post:96

Points:676
Posted by  ben reitman
 744  View(s)
Ratings:
Rate this:

In Visual Studio 2012, I attemped to debug my WP 7.5 project which uses a WCF Service hosted on the same dev machine. I keep getting the following error:

System.ServiceModel.CommunicationException
Message: The remote server returned an error: NotFound.

The strange thing is that there is no problem invoking the service in a Console, but in WP Emulator no luck. All works fine with Visual 2012.

  1. Mayank Tripathi

    Post:397

    Points:3117
    Re: Visual Studio 2012 Windows Phone 8 WCF - System.ServiceModel.CommunicationException

    That symptom indicates the service cannot be found.  Note that you cannot use localhost in your address, as you might have been doing in WP7, because the emulator is a completely different computer instance with its own internal localhost.

    Before you can connect successfully from the emulator to the local web 
    service, you have to make two changes:

    • You have to reconfigure the local web service and web server to accept 
      connections from other devices on the network.

    • You have to reconfigure the service reference in the Windows Phone app to 
      connect to the service by using the IP address of the development computer on 
      which the service is running.

    There are plans afoot to update the MSDN documentation to explain this in further detail.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!