在本地计算机上的服务启动后又停止了

在本地计算机上的服务启动后又停止了

本文介绍了在本地计算机上的服务启动后又停止了,一些服务自动如果没有通过其他服务或程序中使用停止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个样本窗口服务,并与成功安装我的服务。不过,虽然将启动该服务。我收到以下错误。

I created one sample windows service and installed my service with successfully. But while going to START the service. I am getting below error.

此服务队在本地计算机上启动,然后停止。一些serivces自动停止,如果再不能由其他serives或程序使用

This sevice on local computer started and then stopped.some serivces stop automatically if then are not in use by other serives or programs

我的配置文件code:

<system.serviceModel>
    <services>
      <service name="SvcClient.WCFJobsLibrary.Service1">
        <endpoint address="" binding="wsHttpBinding" contract="WCFJobsLibrary.IService1">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8732/Design_Time_Addresses/WCFJobsLibrary/Service1/" />
          </baseAddresses>
        </host>
      </service>
 </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information,
          set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="True"/>
          <!-- 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>

任何一个可以请建议我...由于在副词。

Can any one please suggest me...Thanks in adv.

推荐答案

您需要指定服务(URI处的服务可以通过客户端来达到)的终点。

You need to specify the endpoint of the service (the URI at which the service can be reached by the client).

您可以在code你实例做了的ServiceHost (一个很普通的例子):

You can do it in the code where you instantiate the ServiceHost (a very generic example):

ServiceHost myHost = new ServiceHost(typeof(TechResponse), new Uri("http://www.somedomain.com/TechResponse"));

这篇关于在本地计算机上的服务启动后又停止了,一些服务自动如果没有通过其他服务或程序中使用停止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 10:43