Background:
One subscriber project runs fine, but the other one fails with this error:
Unhandled Exception: System.InvalidOperationException: No endpoint configuration found in scanned assemblies. This usually happens when NServiceBus fails to load your assembly contaning IConfigureThisEndpoint. Try specifying the type explicitly in the NServiceBus.Host.exe.config using the appsetting key: EndpointConfigurationTypeScanned path: my path here at NServiceBus.Host.Program.ValidateEndpoints(IEnumerable`1 endpointConfigurationTypes) at NServiceBus.Host.Program.GetEndpointConfigurationType() at NServiceBus.Host.Program.Main(String[] args)
My suspicion is that the problem must lie with the NServiceBus publisher messages DLL of the subscriber which is failing to start up. Howerver, I am not sure how to work out what is wrong with this. I have looked at:
I am going insane here and have burned almost a day trying to get this working. Any help would be massively appreciated.
Well, the exception tells you exactly what it is about. It is looking for some class that implements IConfigureThisEndpoint.
Three things come to my mind:
The NServiceBus.Host.exe.config file should look like this:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" />
</startup>
<runtime>
<loadFromRemoteSources enabled="true" />
</runtime>
</configuration>
I think that the "No endpoint config..." exception seems to be thrown for lots of different reasons, and it kind of masks the actual reason. Anyone know a nice way of diagnosing these kind of problems?
The last point happend to me, too. It happended after renaming my assembly and not cleaning the project directory. NServiceBus then ran through all files and found both the old named assembly AND the new named assembly and ended with the same exception.
Please note that this also happens if the second assembly containing the same interface implementation may cause tis error if it is located inside a subfolder. This behaviour had caused me some debugging headaches as I previously had copied my file to a subfolder as a short term backup...
[Edit]
Edited to add the additional items by the other authors in this thread for completeness.
[EDIT 2]
Added more information about NServiceBus.Host.exe.config
.
In my case I've got this exception because I've used NServiceBus.Host.exe from NServiceBus install path. After changed it to bin/debug copy (in both cases: server and client), program is starting correct. Project property -> Debug -> Start external program -> full path to NServiceBus.Host.exe in bin/debug folder
OK a real face-palm moment - The messages DLL the failing subscriber was referencing was delay-signed only. This was causing it to fail with the "No endpoint configuration found..." error. Once I built a strong named version of the messages DLL locally it solved the problem.
I think that the "No endpoint config..." exception seems to be thrown for lots of different reasons, and it kind of masks the actual reason. Anyone know a nice way of diagnosing these kind of problems?
I've also seen something similar when the build properties of the project were set to run on a platform target of x86.
I originally set the project up with an Output type of Console Application which caused it to be created with a platform target of x86.
I later changed the project type to be a Class Library (but failed to change the platform type to "Any CPU").
Changing the platform target to Any CPU made it start working.
Found an additional scenario that could result in this exception that is not currently included in the accepted answer. It is specific to using Azure as the NServiceBus transport/persistence mechanism.
This error has also occurred for us when the Azure SDK is not properly installed. (How does that happen? The platform installer works great if you're getting the latest version of the SDK, but otherwise installing the SDK components individually can result in missed components.)
Digging into details: Fusion Log indicated that NServiceBus.Host.exe couldn't resolve Microsoft.WindowsAzure.ServiceRuntime.
The solution was to install all of the following components (even the emulator was needed in order to get all the dependencies resolved):
In our paricular case, we had to get the 2.3 version of the sdk from: http://www.microsoft.com/en-US/download/details.aspx?id=42317
Hope this information helps someone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With