You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System.InvalidCastException
HResult=0x80004002
Message=Unable to cast object of type 'System.Collections.ObjectModel.ReadOnlyCollection`1[System.Reflection.CustomAttributeTypedArgument]' to type 'System.Array'.
Source=System.Private.CoreLib
StackTrace:
at System.Reflection.Emit.CustomAttributeBuilder.EmitValue(BinaryWriter writer, Type type, Object value) in /_/src/System.Private.CoreLib/src/System/Reflection/Emit/CustomAttributeBuilder.cs:line 456
at System.Reflection.Emit.CustomAttributeBuilder.InitCustomAttributeBuilder(ConstructorInfo con, Object[] constructorArgs, PropertyInfo[] namedProperties, Object[] propertyValues, FieldInfo[] namedFields, Object[] fieldValues) in /_/src/System.Private.CoreLib/src/System/Reflection/Emit/CustomAttributeBuilder.cs:line 170
at System.Reflection.Emit.CustomAttributeBuilder..ctor(ConstructorInfo con, Object[] constructorArgs, PropertyInfo[] namedProperties, Object[] propertyValues) in /_/src/System.Private.CoreLib/src/System/Reflection/Emit/CustomAttributeBuilder.cs:line 41
at NServiceBus.ConcreteProxyCreator.AddCustomAttributeToProperty(CustomAttributeData attributeData, PropertyBuilder propBuilder) in /_/src/NServiceBus.Core/MessageInterfaces/MessageMapper/Reflection/ConcreteProxyCreator.cs:line 112
at NServiceBus.ConcreteProxyCreator.CreateTypeFrom(Type type) in /_/src/NServiceBus.Core/MessageInterfaces/MessageMapper/Reflection/ConcreteProxyCreator.cs:line 45
at NServiceBus.MessageInterfaces.MessageMapper.Reflection.MessageMapper.GenerateImplementationFor(Type interfaceType) in /_/src/NServiceBus.Core/MessageInterfaces/MessageMapper/Reflection/MessageMapper.cs:line 230
at NServiceBus.MessageInterfaces.MessageMapper.Reflection.MessageMapper.InnerInitialize(Type t) in /_/src/NServiceBus.Core/MessageInterfaces/MessageMapper/Reflection/MessageMapper.cs:line 200
at NServiceBus.MessageInterfaces.MessageMapper.Reflection.MessageMapper.InitType(Type t) in /_/src/NServiceBus.Core/MessageInterfaces/MessageMapper/Reflection/MessageMapper.cs:line 146
at NServiceBus.MessageInterfaces.MessageMapper.Reflection.MessageMapper.Initialize(IEnumerable`1 types) in /_/src/NServiceBus.Core/MessageInterfaces/MessageMapper/Reflection/MessageMapper.cs:line 34
at NServiceBus.SerializationFeature.Setup(FeatureConfigurationContext context) in /_/src/NServiceBus.Core/Serialization/SerializationFeature.cs:line 26
at NServiceBus.Features.FeatureActivator.FeatureInfo.InitializeFrom(FeatureConfigurationContext featureConfigurationContext) in /_/src/NServiceBus.Core/Features/FeatureActivator.cs:line 237
at NServiceBus.Features.FeatureActivator.ActivateFeature(FeatureInfo featureInfo, List`1 featuresToActivate, FeatureConfigurationContext featureConfigurationContext) in /_/src/NServiceBus.Core/Features/FeatureActivator.cs:line 194
at NServiceBus.Features.FeatureActivator.SetupFeatures(FeatureConfigurationContext featureConfigurationContext) in /_/src/NServiceBus.Core/Features/FeatureActivator.cs:line 57
at NServiceBus.FeatureComponent.Initalize(FeatureConfigurationContext featureConfigurationContext) in /_/src/NServiceBus.Core/Features/FeatureComponent.cs:line 29
at NServiceBus.EndpointCreator.Initialize() in /_/src/NServiceBus.Core/EndpointCreator.cs:line 61
at NServiceBus.EndpointCreator.Create(SettingsHolder settings, Configuration hostingConfiguration) in /_/src/NServiceBus.Core/EndpointCreator.cs:line 27
at NServiceBus.HostCreator.<CreateWithInternallyManagedContainer>d__1.MoveNext() in /_/src/NServiceBus.Core/Hosting/HostCreator.cs:line 86
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in /_/src/System.Private.CoreLib/shared/System/Runtime/ExceptionServices/ExceptionDispatchInfo.cs:line 63
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) in /_/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/TaskAwaiter.cs:line 180
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in /_/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/TaskAwaiter.cs:line 151
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() in /_/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/TaskAwaiter.cs:line 563
at NServiceBus.Endpoint.<Start>d__1.MoveNext() in /_/src/NServiceBus.Core/Endpoint.cs:line 29
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in /_/src/System.Private.CoreLib/shared/System/Runtime/ExceptionServices/ExceptionDispatchInfo.cs:line 63
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) in /_/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/TaskAwaiter.cs:line 180
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in /_/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/TaskAwaiter.cs:line 151
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() in /_/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/TaskAwaiter.cs:line 563
at Program.<Main>d__0.MoveNext() in C:\Code\docs.particular.net\samples\rabbitmq\simple\Rabbit_5\Sample\Program.cs:line 19
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in /_/src/System.Private.CoreLib/shared/System/Runtime/ExceptionServices/ExceptionDispatchInfo.cs:line 63
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) in /_/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/TaskAwaiter.cs:line 180
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in /_/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/TaskAwaiter.cs:line 151
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() in /_/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/TaskAwaiter.cs:line 107
at Program.<Main>()
This exception was originally thrown at this call stack:
System.Reflection.Emit.CustomAttributeBuilder.EmitValue(System.IO.BinaryWriter, System.Type, object) in CustomAttributeBuilder.cs
System.Reflection.Emit.CustomAttributeBuilder.InitCustomAttributeBuilder(System.Reflection.ConstructorInfo, object[], System.Reflection.PropertyInfo[], object[], System.Reflection.FieldInfo[], object[]) in CustomAttributeBuilder.cs
System.Reflection.Emit.CustomAttributeBuilder.CustomAttributeBuilder(System.Reflection.ConstructorInfo, object[], System.Reflection.PropertyInfo[], object[]) in CustomAttributeBuilder.cs
NServiceBus.ConcreteProxyCreator.AddCustomAttributeToProperty(System.Reflection.CustomAttributeData, System.Reflection.Emit.PropertyBuilder) in ConcreteProxyCreator.cs
NServiceBus.ConcreteProxyCreator.CreateTypeFrom(System.Type) in ConcreteProxyCreator.cs
NServiceBus.MessageInterfaces.MessageMapper.Reflection.MessageMapper.GenerateImplementationFor(System.Type) in MessageMapper.cs
NServiceBus.MessageInterfaces.MessageMapper.Reflection.MessageMapper.InnerInitialize(System.Type) in MessageMapper.cs
NServiceBus.MessageInterfaces.MessageMapper.Reflection.MessageMapper.InitType(System.Type) in MessageMapper.cs
NServiceBus.MessageInterfaces.MessageMapper.Reflection.MessageMapper.Initialize(System.Collections.Generic.IEnumerable<System.Type>) in MessageMapper.cs
NServiceBus.SerializationFeature.Setup(NServiceBus.Features.FeatureConfigurationContext) in SerializationFeature.cs
...
[Call Stack Truncated]
The text was updated successfully, but these errors were encountered:
Ha! Yeah, it's one of those things that keeps messing with you. It turns out I had "thumbed up" this issue some months back and had forgotten. So now I spent yet another hour trying to figure out what was going on and preparing a new issue, only to find this existing issue once again... well at least I got to make a screenshot this time :)
SzymonPobiega
changed the title
Enabling C# 8 nullable references can still throw exception on interface messages
Complex nullable reference types cannot be used on the interface-based message types
Mar 29, 2021
While #5488 fixed problems related to using nullable references with interface messages, it's been reported that we still have a problem.
Whenever the interface has a property that is a nullable array, it fails.
On startup, the following exception is thrown:
The text was updated successfully, but these errors were encountered: