问题
Error while running an installed Windows Service on dedicated Server
I installed my windows service on my virtual dedicated server using the exe file of my windows service.
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?
回答1:
Did you supply an app.config for the service .exe?
It looks like it's either missing or incorrect from the exception message:
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.
来源:https://stackoverflow.com/questions/6201631/error-while-running-an-installed-windows-service-on-dedicated-server