Scary "Lack of endpoint configuration in verified assemblies" NServiceBus error

Background:

  • I have two NServiceBus endpoint projects in my solution.
  • Both are NServiceBus subscribers and contain a message handler for a single message.
  • Each subscriber project processes a message from one of two different publishers. Thus, one project references DLL messages from one publisher, and another refers to DLL messages from another publisher.
  • Both publishers are external to my decision.
  • In addition to message DLLs, both subscriber projects reference the same binaries for NServiceBus and additionally have the same settings (UnicastBusConfig, EndpointConfig, appSettings, etc.).

One subscriber project runs fine, but another does not work with this error:

Unhandled exception: System.InvalidOperationException: Endpoint configuration not found in validated assemblies. This usually happens when NServiceBus cannot load your IConfigureThisEndpoint assembly. Try explicitly specifying the type in NServiceBus.Host.exe.config using the appsetting key: EndpointConfigurationTypeScanned path: my path is here in NServiceBus.Host.Program.ValidateEndpoints (IEnumerable`1 endpointConfigurationTypes) in NServiceBus.Host.Program.GetTerpointususus. Host.Program.Main (String [] args)

My suspicion is that the problem should be that the publisher subscriber DLL of the NServiceBus subscriber does not start. Hauverver, I do not know how to understand this. I watched:

  • and NServiceBus publisher DLLs are published using ildasm, and they are identical (relative to processor flags and NServiceBus DLL versions).
  • NSB message projects that were built using the .Net 3.5 Framework.

I'm going crazy and almost burned for almost a day, trying to get this to work. Any help would be greatly appreciated.

+6
source share
5 answers

Well, the exception tells you exactly what it is. He is looking for some class that implements IConfigureThisEndpoint .

Three things come to mind:

  • You forgot to implement it (see NServiceBus samples)
  • You have implemented it, but your class is not public or internal
  • You have more than one assembly in a folder or subfolder that contains your files that implement IConfigureThisEndpoint
  • You have a mismatch between the framework versions of your assemblies and the NServiceBus assemblies, i.e. you are using NServiceBus compiled for .NET 3.5, but Visual Studio 2010 created your endpoint (default) as .NET 4.0. (dot added by David Boike )
  • The DLL messages referenced by the failed subscriber are delayed. This leads to a crash with the error "There is no endpoint configuration ...". Building a strong named version of the DLL messages locally solves the problem. (dot added by thecolour )
  • The exception "Missing endpoint config ..." seems to be thrown for various reasons, and this seems to mask the actual reason. The exception basically only says that the configuration cannot be found, but does not indicate what is the underlying cause of the problem. (dot added by thecolour )
  • The version of NServiceBus we are using does not compile in .NET v4. Therefore, we need to create the configuration file NServiceBus.Host.exe.config , which configures the version of .NET used.
    • Remember to install the above file NServiceBus.Host.exe.config , which will be copied to the / bin / Debug folder in the property windows. It happens to me all the time ...; -)

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 the exception β€œNo endpoint config ...” seems to be thrown for many different reasons, and this kind of masks the actual reason. Does anyone know a good way to diagnose such problems?

The last point with me too. This happened after renaming my assembly and not clearing the project directory. NServiceBus then looked through all the files and found both the old named assembly and the new named assembly and ended up with the same exception.

Note that this also happens if a second assembly containing the same interface implementation can cause a tis error if it is inside a subfolder. This behavior caused me some debugging headaches, as I previously copied my file to a subfolder as a short-term backup ...

[change]

Edited to add additional elements by other authors in this thread for completeness.

[EDIT 2]

Additional information about NServiceBus.Host.exe.config .

+13
source

In my case, I have this exception because I used NServiceBus.Host.exe from the NServiceBus installation path. After you change it to bin / debug copy (in both cases: server and client), the program starts correctly. Project property -> Debug -> Run external program -> full path to NServiceBus.Host.exe in the bin / debug folder

+4
source

OK real moment of the palm - the DLL messages referenced by the failed subscriber were only delayed. This caused an error with the error "Endpoint configuration error ...". As soon as I built a strong named version of the message DLL, locally it solved the problem.

I think the exception β€œNo endpoint config ...” seems to be thrown for many different reasons, and this kind of masks the actual reason. Does anyone know a good way to diagnose such problems?

+1
source

I also saw something similar when project build properties were configured to run on the x86 target platform.

I initially defined a project with the Console Application output type, which caused it to be created with the x86 target platform.

Later, I changed the project type as a class library (but could not change the platform type to β€œAny processor”).

Changing the purpose of the platform on any CPU launched its work.

+1
source

An additional scenario was found that could lead to this exception , which is not currently included in the accepted answer. It is specific to use Azure as the NServiceBus transfer / persistence mechanism.

This error also occurred to us when the Azure SDK was not installed correctly. (How does this happen? The platform installer works fine if you get the latest version of the SDK, but otherwise installing the SDK components may result in missing components.)

Going into the details: Fusion magazine indicated that NServiceBus.Host.exe could not resolve Microsoft.WindowsAzure.ServiceRuntime.

The solution was to install all of the following components (even an emulator was needed to solve all the dependencies):

  • WindowsAzureStorageTools.msi
  • WindowsAzureEmulator-x64.exe
  • WindowsAzureTools.vs120.exe
  • WindowsAzureAuthoringTools-x64.msi
  • WindowsAzureLibsForNet-x64.msi

In our particular case, we had to get sdk 2.3 version: http://www.microsoft.com/en-US/download/details.aspx?id=42317

We hope this information helps someone.

+1
source

Source: https://habr.com/ru/post/888802/


All Articles