Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Sales forum / Microsoft.ServiceBus D...
Sales forum

Microsoft.ServiceBus DLL - System.Security.SecurityException: That assembly does not allow partially trusted callers.

(0) ShareShare
ReportReport
Posted on by

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)

Categories:

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Sales

Featured topics

Product updates

Dynamics 365 release plans