【问题标题】:Debugging a WCF service hosted inside a windows service from an ASP.NET MVC client hosted on local IIS从本地 IIS 上托管的 ASP.NET MVC 客户端调试 Windows 服务内托管的 WCF 服务
【发布时间】:2011-07-12 19:42:13
【问题描述】:

朋友们, 我有一个 WCF 服务,我试图从我的 MVC 2 Web 客户端本地进入。WCF 服务托管在同一解决方案内的 Windows 服务中。我安装了 Windows 服务并确保它正在运行。但是当我尝试进入 WCF 服务,我收到以下错误消息 “无法进入远程过程”。

这是我的客户端和主机配置

主机

<host>
    <service name="MyService" behaviorConfiguration="ServiceBehavior">
        <host>
            <baseAddresses>
                <add baseAddress="http://localhost:8000/MyService" />
                <add baseAddress="net.tcp://localhost:9002/MyService" />
            </baseAddresses>
        </host>
        <endpoint address="" bindingConfiguration="bigTcpArrayBinding" binding="netTcpBinding" contract="IMyServices" />
        <endpoint address="" bindingConfiguration="bigArrayBinding" binding="basicHttpBinding" contract="IMyServices" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    </service>
</host>

和 客户是

<client>
    <endpoint address="net.tcp://localhost:9002/MyService" binding="netTcpBinding" bindingConfiguration="bigTcpArrayBinding" contract="LPS.HAMP.MARS.IHampServices" name="SANDBOX_HampServicesSvcContract" />
</client>

我在 Windows 7 上使用 VS 2010。非常感谢任何帮助

谢谢 RJ

【问题讨论】:

    标签: wcf visual-studio-debugging


    【解决方案1】:

    你可以调试一个正在运行的windows服务,去Debug -> Attach to process -> 找到服务的名字,VS会附加到这个正在运行的服务上。

    【讨论】:

    • 谢谢伙计。我通过将其附加到 w3wp.exe iis 进程来调试我的 Web 客户端。那么我们可以在 VS 中将调试器附加到多个进程吗?
    • 是的,我一次连接了几个 Windows 服务,但是一次连接的数量可能有限制。
    猜你喜欢
    • 2016-09-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-12-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多