I want to use the NServiceBus Ge开发者_如何学编程neric Host for running my subscriber as a service. My subscriber uses no-XML configuration, so there is no need for an app.config. My problem is that since I don't have an app.config, I get this error from the Generic host:
No configuration file found at: C:\My Dev\NServiceBus2.0.0.1145\samples\PubSub\Subscriber2\bin\Debug\Subscriber2.dll.config
Is there a way to disable to default behavior of the Generic host to NOT search for the .config file?
Looks like there is no way around this except to host NSB on your own(from the host source):
string endpointConfigurationFile = GetEndpointConfigurationFile(endpointConfigurationType);
if (!File.Exists(endpointConfigurationFile))
{
throw new InvalidOperationException("No configuration file found at: " + endpointConfigurationFile);
}
精彩评论