Dynamics 365 version 8.2.24.23
We want to send messages from Dynamics 365 to the Azure Service Bus. To do this we merged microsoft.servicebus.dll into the main DLL through ilmerge. When we invoke the DLL through a custom workflow activity we get the exception below.
Is there anyway around the partially trusted caller issue? As a workaround, we can call the Azure Service Bus via the REST API but we'd prefer not to do that.
System.Security.SecurityException: That assembly does not allow partially trusted callers.
at Microsoft.ServiceBus.Messaging.MessagingFactorySettings..ctor()
at Microsoft.ServiceBus.Messaging.Configuration.KeyValueConfigurationManager.CreateFactory(IEnumerable`1 endpoints, IEnumerable`1 stsEndpoints, IEnumerable`1 viaEndpoints, String operationTimeout, String issuerName, String issuerKey, String sasKeyName, String sasKey, String sasToken, String windowsDomain, String windowsUser, SecureString windowsPassword, String oauthDomain, String oauthUser, SecureString oauthPassword, String transportType, String enableAmqpLinkRedirect, String amqpSecurityScheme)
at Microsoft.ServiceBus.Messaging.Configuration.KeyValueConfigurationManager.GetOrUpdateFactory(IEnumerable`1 endpoints, IEnumerable`1 stsEndpoints, IEnumerable`1 viaEndpoints, String operationTimeout, String issuerName, String issuerKey, String sasKeyName, String sasKey, String sasToken, String windowsDomain, String windowsUser, SecureString windowsPassword, String oauthDomain, String oauthUser, SecureString oauthPassword, String transportType, String enableAmqpLinkRedirect, String amqpSecurityScheme)
at Microsoft.ServiceBus.Messaging.Configuration.KeyValueConfigurationManager.CreateMessagingFactory(Boolean useCachedFactory)
at Microsoft.ServiceBus.Messaging.MessagingFactory.CreateFromConnectionString(String connectionString, Boolean useCache)
at Microsoft.ServiceBus.Messaging.TopicClient.CreateFromConnectionString(String connectionString, String path)