我有一个使用netTcpBinding,transferMode =“Streamed”的WCF服务,并通过Windows Process Activation Services方法通过installutil安装。该服务构建和安装就好了。我在包含文件夹上拥有NETWORK SERVICES的所有正确权限,以访问.exe文件。我的问题是我一直收到错误:
“本地计算机上的服务[ServiceName]已启动然后停止。如果某些服务未被其他服务或程序使用,则会自动停止。”
奇怪的是主机安装程序代码与我运行的缓冲服务相同。在流服务中,我在需要时考虑了传递流和消息。我被卡住了。我似乎无法找出为什么这项服务不会站起来。我检查了端口,它们是开放的(没有冲突)。有没有人对'Streamed'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>
答案 0 :(得分:0)
看来,即使使用Visual Studio 2012,我遇到了这个错误(最初发布于VS 2010):
Bug 571961 (marked as closed) - "Unable to Copy File"
此错误抛出“无法复制文件...因为它正被另一个进程使用”错误。解决方法对我有用 - 清理项目。关闭Visual Studio。重新打开VS.建立项目。按照这个过程,我可以建立我的服务。
此外,在重复构建时,部分问题是需要在构建之前“停止”服务管理器中的服务。一定不要忘记这一点。