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

.net 在专用服务器上运行已安装的Windows服务时出错,.net,.net-3.5,service,windows-services,.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'

在专用服务器上运行已安装的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)

有什么问题吗?

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

从异常消息看,它似乎缺失或不正确:

找不到默认终结点 引用合同的要素 中的“MyService.MyServSoap” ServiceModel客户端配置 节。这可能是因为没有 已找到您的配置文件 应用程序,或者因为没有端点 与此合同匹配的元素可以 可以在客户端元素中找到


您正在从服务调用WCF端点上的操作吗?您的windows服务配置文件中有正确的信息(地址/绑定/合同)吗?@kd7:是的,我的windows服务配置文件中有正确的名称和地址,但它仍然给出了错误。就地址和端点属性值而言,我尝试了所有不同的可能性。我提供了app.config文件,并且在app.config文件中创建了正确的端点。我尝试了各种端点值,但都不起作用。@PARTH您能在这里发布app.config的端点部分吗?