我有一个使用 netTcpBinding、transferMode="Streamed" 的 WCF 服务,并通过 Windows Process Activation Services 方法通过 installutil 安装。该服务的构建和安装都很好。我对包含文件夹的 NETWORK SERVICES 拥有所有正确的权限来访问 .exe 文件。我的问题是我不断收到错误:
“本地计算机上的服务 [ServiceName] 启动然后停止。如果某些服务没有被其他服务或程序使用,它们会自动停止。”
奇怪的是主机安装程序代码与我拥有的运行良好的缓冲服务相同。在流式服务中,我考虑了在需要的地方传递流和消息。我被困住了。我似乎无法找出为什么这项服务不会站起来。我检查了端口,它们是开放的(没有冲突)。有人对未启动的“流式”netTcp 服务有什么建议吗?
下面是 App.Config 的样子:
<system.serviceModel>
<!--### Service Endpoints: ###-->
<!--Define Bindings-->
<bindings>
<netTcpBinding>
<binding name="netTcpStreamedBinding" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:20:00" sendTimeout="00:10:00"
transferMode="Streamed" maxBufferPoolSize="104857600"
maxReceivedMessageSize="1073741824" maxBufferSize="262144">
<!-- Commented below out to match service that worked to see if this was error - It is not the problem (still no start)
<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows" />
</security>-->
</binding>
</netTcpBinding>
</bindings>
<!--Streamer Service-->
<services>
<service name="MyServiceLib.FileStreamer">
<endpoint address="" binding="netTcpBinding" bindingConfiguration="netTcpStreamedBinding" contract="MyServiceLib.IFileStreamer">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:.../MyStreamerService"/>
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information,
set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="False" httpsGetEnabled="False"/>
<!-- To receive exception details in faults for debugging purposes,
set the value below to true. Set to false before deployment
to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>