Am trying to listen to an azure service bus queue but am getting an exception when initializing the connection to to the queue. I have tried to search for a way out but with less success. Note that am using .NETCore 2.1. This is how am initializing the connection it:
// Initialize the connection to Service Bus Queue
_queueClient = QueueClient.CreateFromConnectionString(_interswitchQueueConnectionString, _interswitchQueueName, ReceiveMode.ReceiveAndDelete);
And this the exception am getting:
System.TypeInitializationException: The type initializer for 'Microsoft.ServiceBus.Messaging.Constants' threw an exception. ---> System.TypeLoadException: Could not load type 'System.UriTemplate' from assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. at Microsoft.ServiceBus.Messaging.Constants..cctor() --- End of inner exception stack trace --- at Microsoft.ServiceBus.ServiceBusConnectionStringBuilder..ctor() at Microsoft.ServiceBus.Messaging.QueueClient.CreateFromConnectionString(String connectionString, String path, ReceiveMode mode)
The same initialization works fine when using .net framework. How can I do it in .NetCore ? Please Help Thanks in advance