wcf - 如何在 Windows Vista 上使用 netNamedPipeBinding 和 WAS 在 Web 应用程序中托管 WCF 服务

标签 wcf windows-vista was netnamedpipebinding

我正在尝试在 Vista 机器上的 Web 应用程序中使用 netNamedPipeBinding 托管 WCF 服务。

我启用了本文所述的非 HTTP 服务激活:http://msdn.microsoft.com/en-us/library/ms731053.aspx

我将服务配置如下:

<endpoint address="net.pipe://myservice"
binding="netNamedPipeBinding"
bindingConfiguration="MyService_NamedPipeBindingConfig"
contract="ICMyService" />

<netNamedPipeBinding>
    <binding name="MyService_NamedPipeBindingConfig"
         maxBufferSize="2147483647"
         maxReceivedMessageSize="2147483647">
        <security mode="None">
            <transport protectionLevel="None" />
        </security>
    </binding>
</netNamedPipeBinding>

当我浏览到 .svc 文件(在 IIS 上,而不是 Visual Studio 网络服务器上)时,我收到以下消息:
[InvalidOperationException: The protocol 'net.pipe' is not supported.]
   System.ServiceModel.Activation.HostedTransportConfigurationManager.InternalGetConfiguration(String scheme) +11461251
   System.ServiceModel.Channels.TransportChannelListener.OnOpening() +84
   System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +229
   System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) +72

[InvalidOperationException: The ChannelDispatcher at 'net.pipe://myservice' with contract(s) '"IMyService"' is unable to open its IChannelListener.]
   System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) +118
   System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +261
   System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +107
   System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +261
   System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +121
   System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +479

[ServiceActivationException: The service '/myservicehost/myservice.svc' cannot be activated due to an exception during compilation.  The exception message is: The ChannelDispatcher at 'net.pipe://myservice' with contract(s) '"IMyService"' is unable to open its IChannelListener..]
   System.ServiceModel.AsyncResult.End(IAsyncResult result) +11536522
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +194
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) +176
   System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +278
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

我希望使用 WAS 进行更快、更轻松的部署,但是这个异常(exception)没有帮助。有没有人知道我做错了什么?

最佳答案

您是否完全按照那篇文章进行操作,或者您是否将命令行中的“net.tcp”实例替换为“net.pipe”?可能只是您没有为该网站和您的虚拟目录启用 net.pipe 绑定(bind)。

关于wcf - 如何在 Windows Vista 上使用 netNamedPipeBinding 和 WAS 在 Web 应用程序中托管 WCF 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1330748/

相关文章:

memory - Vista中的静态内存分配会导致崩溃吗?

wcf - 在两个 tcp 端口上使用 net.tcp 绑定(bind)在 IIS 7 (WAS) 中托管 WCF 服务

c# - WCF 服务无法通过 MailDefinition 发送邮件

wcf - WCF 服务通常是否应该是单例的?

c# - wcf 客户端 ip 作为 ipv6

c# - 如何计算网络速度?

.net - Windows 窗体 .NET 2.0 : How to draw a PNG icon?

Delphi 多线程应用程序在 Vista 中内置,无法在 XP 中运行

wcf - WAS 非 HTTP 激活 - Hook 应用程序启动