使用 WCF 应用程序,"An error occurred while sending the request" VB

Using a WCF application, "An error occurred while sending the request" VB

我编写了一个非常基本的 WCF 应用程序,我将其托管在 IIS 服务器上。使用测试客户端,(来自 Visual Studio)函数 returns 一个整数;这是有意的。

但是,我的客户端应用程序(通用 Windows 10 应用程序)迫使我使用异步方法。 下面的代码是我用来调用该方法的代码。尽管它因标题中显示的错误而在 Await 处窒息。 (System.ServiceModel.CommunicationException)

    Dim theService As New MyService.Service1Client()
    Dim a = Await theService.giveNumberAsync()
    Dim dialog = New MessageDialog(a.ToString)
    dialog.ShowAsync()

理想情况下,我希望它返回该值,但对如何进一步解决这个问题感到困惑

您是否为您的应用提供了功能

  • 互联网(客户端)
  • 互联网(客户端和服务器)
  • 专用网络(客户端和服务器)

在清单中?