Particular / NServiceBus.Host

https://docs.particular.net/nservicebus/hosting/nservicebus-host/
Other
6 stars 18 forks source link

Host blows up during assembly scanning #115

Open andreasohlund opened 7 years ago

andreasohlund commented 7 years ago

Since NServiceBus core Version 6 now can return partially scannable assemblies the host will blow up since it does its own .GetTypes() call on each assembly in order to find the class implementing IConfigureThisEndpoint.

Symptoms

The Version 7 host blows up during startup if there is a assembly that is partially scannable. This forces the users to add assembly redirects to both NServiceBus.Host.exe.config and app.config

Who's affected

All version 7 users.

Workaround

Add a NServiceBus.Host.exe.config file with the same redirects as the app.config

Replaces #114

SimonCropp commented 7 years ago

should this have a milestone?

SeanFeldman commented 7 years ago

In addition to @SimonCropp `s question, should a bug issue have proper sections to appear in the release notes?

adamralph commented 7 years ago

ping @Particular/host-maintainers

seanfarmar commented 7 years ago

@ramonsmits Let's have a quick sync next week?

ramonsmits commented 7 years ago

@andreasohlund So why was this an issue? Why do we do not want the previous behavior? If some kind of binding redirect is incorrect or an assembly is missing wouldn't we want to blow up? The google group post also indicates that the issue was a missing assembly that made the project work after adding it.

andreasohlund commented 7 years ago

So why was this an issue? Why do we do not want the previous behavior? If some kind of binding redirect is incorrect or an assembly is missing wouldn't we want to blow up?

The host has always done a best effort scanning to find the endpoint config (and throw if not found). If the scanner issues isn't not resolved by redirects in app.config the endpoint would throw when it starts instead.

This saves the user from having to put redirect in both NServiceBus.Host.exe.config and their own app.config (not that both we and nuget actually auto adds the correct redirects to app.config)

In short: To not annoy users we should not throw in the "outer scan"

Does this make sense?

ramonsmits commented 7 years ago

@andreasohlund Ok, got it, it is specific in resolving the IConfigureThisEndpoint to check if it can be located although other scanned types could not be resolved.

That makes sense, especially if there are types that would never be used at runtime at all.

adamralph commented 7 years ago

So should this be added to a 7.1.0 milestone?