错误而运行已安装的Windows服务在专用服务器上器上、错误、Windows

2023-09-07 10:32:34 作者:人潮拥挤我找不着厕所

错误,而在专用服务器上运行的Windows安装服务

Error while running an installed Windows Service on dedicated Server

我用我的Windows服务的EXE文件安装在我的窗口服务我的虚拟专用服务器上。

I installed my windows service on my virtual dedicated server using the exe file of my windows service.

当我尝试从虚拟专用服务器然后我得到以下错误运行我的Windows服务。

When I try to run my windows service from a virtual dedicated server then I get following error.

 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)

什么地方出错了?

What could be wrong?

推荐答案

你提供一个app.config为服务的.exe?

Did you supply an app.config for the service .exe?

它看起来像它的缺失或不正确的异常消息:

It looks like it's either missing or incorrect from the exception message:

找不到默认端点   元素引用合同   在'MyService.MyServSoap'   ServiceModel客户端配置   部分。这可能是因为没有   配置文件被发现的你   应用程序,或者因为没有端点   元件匹配这份合同可以   在客户端元件中找到。

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.