I am currently facing error while running the NSB worker. The error details as logged in NSB log file is as follows :-
2017-12-05 10:09:28.494 INFO DefaultFactory Logging to 'C:<project path worker>\bin\Debug' with level Info
2017-12-05 10:09:28.711 ERROR NServiceBus.GenericHost Exception when starting endpoint.
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
at NServiceBus.Hosting.Profiles.ProfileManager.GetImplementor[T](Type openGenericType) in c:\BuildAgent\work\a3de8759ee491634\src\NServiceBus.Hosting.Profiles\ProfileManager.cs:line 60
at NServiceBus.GenericHost.PerformConfiguration(Action`1 moreConfiguration) in c:\BuildAgent\work\a3de8759ee491634\src\NServiceBus.Hosting.Windows\GenericHost.cs:line 99
at NServiceBus.GenericHost.Start() in c:\BuildAgent\work\a3de8759ee491634\src\NServiceBus.Hosting.Windows\GenericHost.cs:line 58
The exception i.e. captured in visual studio is :-
System.Reflection.ReflectionTypeLoadException was unhandled
Message: An unhandled exception of type âSystem.Reflection.ReflectionTypeLoadExceptionâ occurred in mscorlib.dll
Additional information: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
I have tried looking for help in SO based on the post -
However, the debugger is not hitting the endpoint config. The exception is throw prior to the same. â
public class EndpointConfig : IConfigureThisEndpoint, AsA_Server
{// debugger here
public void Customize(BusConfiguration configuration)
{
try
{
var endPointName = ConfigurationManager.AppSettings[âendpointâ];
//other config params.
}
catch
{}
}
}
I donât know about Rakesh and his redirects, but Iâm experiencing a similar problem and I believe weâve got the redirects in place, i.e.
2018-01-30 13:41:28.258 INFO DefaultFactory Logging to 'D:\Octopus\Applications\aTest\JDM.Deploy.NettWebAdmin.Services.Messaging.Endpoint\0.1.0-unstable0191\' with level Info
2018-01-30 13:41:28.274 WARN NServiceBus.Hosting.Helpers.AssemblyScanner Could not enumerate all types for 'D:\Octopus\Applications\aTest\JDM.Deploy.NettWebAdmin.Services.Messaging.Endpoint\0.1.0-unstable0191\NServiceBus.NHibernate.dll'.
It looks like you may be missing binding redirects in the config file for the following assemblies:
NHibernate, Version=4.0.4.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4
For more information see http://msdn.microsoft.com/en-us/library/7wd6ex19(v=vs.100).aspx
(The same entries are found in app.config as well). Because of this (annoying) error weâre unable to deploy this particular endpoint and it is getting a wee-bit frustrating to say the least.
Weâre running NServiceBus.NHibernate v7.2.2
Not sure if Iâm allowed to share the project with you. Iâll have to check with the âgold ownerâ tomorrow.
I think it might be the Iesi.Collections reference that is causing the issue, NServiceBus.NHibernate is compiled against 4.0.1.4000 can you try to change that redirect as well?
What happens when I run the endpoint using F5 is that I donât see any loader exception(s), only the following message and then the end point shuts down.
2018-01-30 15:50:08.804 INFO DefaultFactory Logging to 'C:\repos\opp-nettwebadmin\BackEnd\NettWebAdmin.Services.Messaging.Endpoint\bin\Debug\' with level Info
Yes. weâre using SqlServer transport due to high availability requirements. I know Iâm a bit lazy now, but what Iâm trying to do is to go from this:
to configuration in code. Iâll read the articles provided, but if youâve got a code example for me using the settings above Iâd be more than happy