Exception! System.NotSupportedException: The invoked member is not supported in a dynamic assembly.
at System.Reflection.Emit.InternalAssemblyBuilder.GetManifestResourceNames()
at NHibernate.Cfg.Configuration.GetAllHbmXmlResourceNames(Assembly assembly)
at NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly)
at NServiceBus.Features.NHibernateSagaStorage.ApplyMappings(ReadOnlySettings settings, Configuration configuration) in C:\BuildAgent\work\5135de308b2f3016\src\NServiceBus.NHibernate\SagaPersisters\NHibernateSagaStorage.cs:line 42
at NServiceBus.Features.NHibernateSagaStorage.<>c__DisplayClass1_0.<Setup>b__0(Configuration c) in C:\BuildAgent\work\5135de308b2f3016\src\NServiceBus.NHibernate\SagaPersisters\NHibernateSagaStorage.cs:line 29
at NServiceBus.Features.SharedMappings.<>c__DisplayClass1_0.<ApplyTo>b__0(Action`1 m) in C:\BuildAgent\work\5135de308b2f3016\src\NServiceBus.NHibernate\SharedSession\SharedMappings.cs:line 15
at System.Collections.Generic.List`1.ForEach(Action`1 action)
at NServiceBus.Features.SharedMappings.ApplyTo(Configuration configuration) in C:\BuildAgent\work\5135de308b2f3016\src\NServiceBus.NHibernate\SharedSession\SharedMappings.cs:line 15
at NServiceBus.Features.NHibernateStorageSession.Setup(FeatureConfigurationContext context) in C:\BuildAgent\work\5135de308b2f3016\src\NServiceBus.NHibernate\SharedSession\NHibernateStorageSession.cs:line 31
at NServiceBus.Features.FeatureActivator.ActivateFeature(FeatureState featureState, IEnumerable`1 featuresToActivate, FeatureConfigurationContext context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Features\FeatureActivator.cs:line 240
at NServiceBus.Features.FeatureActivator.SetupFeatures(FeatureConfigurationContext context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Features\FeatureActivator.cs:line 116
at NServiceBus.Configure.Initialize() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Configure.cs:line 115
at NServiceBus.Bus.Create(BusConfiguration configuration) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Bus.cs:line 17
at Parlam.TMS.SharedKernel.NServiceBus.EndpointBase.Run() in G:\tfs\parlam\Parlam\TMS\Features\Workflows\Source\Parlam.TMS.Web\Shared Kernel\Parlam.TMS.SharedKernel.NServiceBus\EndpointBase.cs:line 68
at Parlam.TMS.Workflows.Host.Program.<AsyncMain>d__1.MoveNext() in G:\tfs\parlam\Parlam\TMS\Features\Workflows\Source\Parlam.TMS.Web\Workflows\Parlam.TMS.Workflows.Host\Program.cs:line 41
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
I have an endpoint using NHibernate persistence, SqlTransport and Outbox. The endpoint was correctly handling and sending messages. Now I've added a saga with a simple saga data class (a unique int property and a Guid property) and when the endpoint starts it throws the shown exception. I've used Sagas with NHibernate persistence on another project and it worked fine and I can't see any relevant difference in the configuration.
So, as far as I can tell, NHibernate is calling GetManifestResourceNames on a dynamic Assembly, which it seems it's not supported. But I don't know what Assembly this is because there is no logging for this.
It seems that the assemblies come from the types in NServiceBus.SettingsExtentions.GetAvailableTypes(settings), but I don't know how to access this list in order to find the offending assembly.
Does anyone know what this error is about or how to print the list of assemblies?