{"action":"created","issue":{"url":"https://api.github.com/repos/Particular/NServiceBus.RabbitMQ/issues/111","labels_url":"https://api.github.com/repos/Particular/NServiceBus.RabbitMQ/issues/111/labels{/name}","comments_url":"https://api.github.com/repos/Particular/NServiceBus.RabbitMQ/issues/111/comments","events_url":"https://api.github.com/repos/Particular/NServiceBus.RabbitMQ/issues/111/events","html_url":"https://github.com/Particular/NServiceBus.RabbitMQ/issues/111","id":123306373,"number":111,"title":"System.InvalidOperationException when using custom IRoutingTopology from same Assembly","user":{"login":"Esbe","id":7863641,"avatar_url":"https://avatars.githubusercontent.com/u/7863641?v=3","gravatar_id":"","url":"https://api.github.com/users/Esbe","html_url":"https://github.com/Esbe","followers_url":"https://api.github.com/users/Esbe/followers","following_url":"https://api.github.com/users/Esbe/following{/other_user}","gists_url":"https://api.github.com/users/Esbe/gists{/gist_id}","starred_url":"https://api.github.com/users/Esbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Esbe/subscriptions","organizations_url":"https://api.github.com/users/Esbe/orgs","repos_url":"https://api.github.com/users/Esbe/repos","events_url":"https://api.github.com/users/Esbe/events{/privacy}","received_events_url":"https://api.github.com/users/Esbe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-21T16:05:48Z","updated_at":"2015-12-21T17:09:54Z","closed_at":null,"body":"When using a custom IRoutingTopology as follows:\r\n```\r\nconfiguration.UseTransport<RabbitMQTransport>()\r\n                .UseRoutingTopology<MyRoutingTopology>();\r\n```\r\nthen NServiceBus.Host will throw the following exception if MyRoutingTopology is in the same Assembly as the EndpointConfig class:\r\n```\r\nAn unhandled exception of type 'System.InvalidOperationException' occurred in NServiceBus.Host.exe\r\n\r\nAdditional information: No endpoint configuration found in scanned assemblies. This usually happens when NServiceBus fails to load your assembly containing IConfigureThisEndpoint. Try specifying the type explicitly in the NServiceBus.Host.exe.config using the appSetting key: EndpointConfigurationType, Scanned path: ...\r\n```\r\nWorkaround: move the MyRoutingTopology class to a referenced project.\r\n\r\n[CustomRoutingTopologyIssue.zip](https://github.com/Particular/NServiceBus.RabbitMQ/files/68665/CustomRoutingTopologyIssue.zip)\r\n"},"comment":{"url":"https://api.github.com/repos/Particular/NServiceBus.RabbitMQ/issues/comments/166362127","html_url":"https://github.com/Particular/NServiceBus.RabbitMQ/issues/111#issuecomment-166362127","issue_url":"https://api.github.com/repos/Particular/NServiceBus.RabbitMQ/issues/111","id":166362127,"user":{"login":"andreasohlund","id":125028,"avatar_url":"https://avatars.githubusercontent.com/u/125028?v=3","gravatar_id":"","url":"https://api.github.com/users/andreasohlund","html_url":"https://github.com/andreasohlund","followers_url":"https://api.github.com/users/andreasohlund/followers","following_url":"https://api.github.com/users/andreasohlund/following{/other_user}","gists_url":"https://api.github.com/users/andreasohlund/gists{/gist_id}","starred_url":"https://api.github.com/users/andreasohlund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreasohlund/subscriptions","organizations_url":"https://api.github.com/users/andreasohlund/orgs","repos_url":"https://api.github.com/users/andreasohlund/repos","events_url":"https://api.github.com/users/andreasohlund/events{/privacy}","received_events_url":"https://api.github.com/users/andreasohlund/received_events","type":"User","site_admin":false},"created_at":"2015-12-21T17:09:54Z","updated_at":"2015-12-21T17:09:54Z","body":"That's an issue with the host scanning, you need to put the\r\n\r\n```\r\n  <runtime>\r\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\r\n      <dependentAssembly>\r\n        <assemblyIdentity name=\"RabbitMQ.Client\" publicKeyToken=\"89e7d7c5feba84ce\" culture=\"neutral\" />\r\n        <bindingRedirect oldVersion=\"0.0.0.0-3.5.7.0\" newVersion=\"3.5.7.0\" />\r\n      </dependentAssembly>\r\n    </assemblyBinding>\r\n  </runtime>\r\n```\r\n\r\nin a file called NServiceBus.Exe.config in your bin folder as well. Or the other option is to specify the host entrypoint explicitly:\r\n\r\nhttp://docs.particular.net/nservicebus/hosting/nservicebus-host/#configuring-your-endpoint\r\n\r\n\r\nDoes this work for you?"}}