-
Notifications
You must be signed in to change notification settings - Fork 782
Description
Description
The parameter MessageReceiver Binding would be bind as string and not as Microsoft.Azure.ServiceBus.Core.MessageReceiver class. The Microsoft Doc states this parameter is a MessageReceiver class and not a System.String (https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-service-bus-trigger?tabs=csharp)
After the execution of a ServiceBusTrigger in C#, the message parameter from Microsoft.Azure.ServiceBus.Message would bind. But trying to access any of message properties would result in exception and the message is "Operation is not valid due to the current state of the object"
All of these issue occurs in .Net 5.0 and using the package Microsoft.Azure.ServiceBus version 5.1.3. I'm using Visual Studio 2019 Version 16.10.2.
All of the issues listed is a non-issue if the project is compiled as a .Net Core 3.1.
Actual Behavior
- MessageReceiver bind as System.String in .Net 5.0 Project
- Message property would exception in .Net 5.0 Project
Expected Behavior
- MessageReceiver should bind as Microsoft.Azure.ServiceBus.Core.MessageReceiver class. This works fine in .Net Core 3.1 Project
- Message property access works fine in .Net Core 3.1 Project but exceptions in .Net 5.0