开发者

NServiceBus: Exception thrown when not using non-XML configuration with Generic host

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);
            }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜