【问题标题】:winforms wcf application works in Visual Studio but not from EXEwinforms wcf 应用程序在 Visual Studio 中工作,但不能在 EXE 中工作
【发布时间】:2013-11-05 19:29:24
【问题描述】:

我使用 WCF DataService 创建了一个 winforms 应用程序。

应用程序在 Visual Studio IDE 中运行,但不是从 debug.exe 运行

在我的 app.config 我有这个端点:

    <client>
        <endpoint address="http://localhost:8733/Design_Time_Addresses/DataService/Service1/"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1"
            contract="ServiceReference1.IService1" name="BasicHttpBinding_IService1" />
    </client>

当我从 exe 运行应用程序时,我收到消息:

“没有端点监听

http://localhost:8733/Design_Time_Addresses/DataService/Service1 

可以接受消息。”

如何在机器上部署服务以便exe可以找到它?

【问题讨论】:

    标签: .net winforms wcf visual-studio-2012 deployment


    【解决方案1】:

    看起来 Design_Time_Addresses 是属于同一解决方案的一个项目,因此 Visual Studio 将在您启动客户端时为您托管此服务。

    因此,当您在 Visual Studio 之外运行客户端时,您需要在 IIS 中托管 Design_Time_Addresses 服务,并将客户端的配置指向该服务实例。

    请参阅此处了解如何部署 IIS 托管的 WCF 服务 http://msdn.microsoft.com/en-us/library/aa751792(v=vs.110).aspx

    【讨论】:

    • 有没有办法在不使用 IIS 的情况下运行这样的应用程序?我希望部署到不是 Web 服务器的 Windows 服务器。
    猜你喜欢
    • 2021-04-07
    • 2014-12-30
    • 1970-01-01
    • 2014-07-16
    • 2013-08-29
    • 1970-01-01
    • 2011-06-17
    • 2020-10-16
    • 2014-05-14
    相关资源
    最近更新 更多