在专用服务器上运行已安装的Windows服务时出错

时间:2011-06-01 13:07:02

标签: .net .net-3.5 service windows-services

在专用服务器上运行已安装的Windows服务时出错

我使用Windows服务的exe文件在我的虚拟专用服务器上安装了我的Windows服务。

当我尝试从虚拟专用服务器运行我的Windows服务时,我收到以下错误。

 Service cannot be started. System.InvalidOperationException: Could not find default endpoint element that references contract 'MyService.MyServSoap' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.
  at System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceEndpoint serviceEndpoint, String configurationName)
at System.ServiceModel.ChannelFactory.ApplyConfiguration(String configurationName)
at System.ServiceModel.ChannelFactory.InitializeEndpoint(String configurationName, EndpointAddress address)
at System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationName, EndpointAddress remoteAddress)
at System.ServiceModel.EndpointTrait`1.CreateSimplexFactory()
at System.ServiceModel.ClientBase`1.CreateChannelFactoryRef(EndpointTrait`1 endpointTrait)

可能出现什么问题?

1 个答案:

答案 0 :(得分:1)

您是否为服务提供了app.config .exe?

从异常消息中看起来它是丢失的或不正确的:

  

无法找到默认端点   引用合同的元素   'MyService.MyServSoap'中   ServiceModel客户端配置   部分。这可能是因为没有   找到了您的配置文件   应用程序,或因为没有端点   匹配此合同的元素可以   可以在客户端元素中找到。