Hi,
I have used ILMerge to add the Microsoft.Servicebus.dll in to my Dynamics 365 Online plugin so that I can send messages to a bus.
I get the following exception when the code is run;
System.TypeLoadException: Inheritance security rules violated while overriding member: 'Microsoft.ServiceBus.AuthorizationFailedException.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)'. Security accessibility of the overriding method must match the security accessibility of the method being overriden. at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes) at System.Reflection.RuntimeAssembly.GetExportedTypes() at Microsoft.Xrm.Sdk.KnownProxyTypesProvider.LoadKnownTypes(Assembly assembly) at Microsoft.Xrm.Sdk.KnownProxyTypesProvider.RegisterAssembly(Assembly assembly) at Microsoft.Xrm.Sdk.AssemblyBasedKnownProxyTypesProvider.GetNameForType(Type type) at Microsoft.Xrm.Sdk.Client.OrganizationServiceContext.CheckEntitySubclass(Type entityType) at Microsoft.Xrm.Sdk.Client.OrganizationServiceContext.CreateQuery[TEntity]() at Xrm.ServiceContext.get_ContactSet() at Co_op.Registry.Integration.Plugin.Steps.PopulatePrimary.Process(Registration registration, reg_registration sourceRecord, ServiceContext service) at Co_op.Registry.Integration.Plugin.Managers.IntegrationManager.CreateRegistrationIndividual(reg_registration sourceRecord, ServiceContext service) at Co_op.Registry.Integration.Plugin.IntegrationAction.Execute(IServiceProvider serviceProvider)
Both my DLL and the service bus DLL are on the same version and I have tried .net 4.5.2 and 4.6.1. Does anyone know how to resolve this issue with ILMerge and the servicebus dll?
*This post is locked for comments