web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Exception System.TypeLoadException: Inheritance security rules violated after DLL merge using ILmereg tool

(0) ShareShare
ReportReport
Posted on by

I have client requirement to call windows Azura hosted webservice by passing SAS token through the CRM plugin. For this we have to use “Microsoft.ServiceBus.dll” for communication with Microsoft Azure Service Bus.

In solution I used the ILmerge tool to merge two DLLS i.e. plugin DLL and Microsoft.ServiceBus.dll, after registering the plugin I am getting following run time error:


Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Unexpected exception from plug-in (Execute): XXXX.CRM.Core.Plugins.ERPIntegrationPlugin: 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.Detail:
<OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">
<ErrorCode>-2147220956</ErrorCode>
<ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic" />
<Message>Unexpected exception from plug-in (Execute): XXXX.CRM.Core.Plugins.ERPIntegrationPlugin: 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.</Message>
<Timestamp>2017-01-14T23:19:05.4342215Z</Timestamp>
<ExceptionSource i:nil="true" />
<InnerFault i:nil="true" />
<OriginalException i:nil="true" />
<TraceText>

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Nadeeja Bomiriya Profile Picture
    6,804 on at

    Hi Gayan,

    Are the two assemblies targeting different .NET versions?  I found some issues incorrect use of ILMerge with assemblies of different target .NET versions.

    The solutions in below articles might be useful to find a clue.

    stackoverflow.com/.../13750130

    entlib.codeplex.com/.../245946

  • Community Member Profile Picture
    on at

    Both DLLs point to .net 4.5, i changed the versions and no luck

  • Community Member Profile Picture
    on at

    Hi,

    I am having the exact same issue, did you manage to find a fix?

  • julians Profile Picture
    612 Moderator on at

    Hi

    I have the same issue. Any ideas?

  • nicknow Profile Picture
    10 on at

    Were you able to resolve this issue? I'm running into a similar issue with some code.

  • Community Member Profile Picture
    on at

    The issue was related to the DLL not being on the same ,net framework. Once this was changed all worked as expected.

  • mluce Profile Picture
    306 on at

    Same issue - both DLLs on .net 4.5.2

  • Community Member Profile Picture
    on at

    Im getting similar error. Below is the exception showing in notification it self

    inheritance security rules violated while overriding member: 'Microsoft.IdentityModel.ClaimsIdentity.System.Runtime.Serialization.Iserializable.GetObjectData(System.Runtime.Serialization.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)'.Security accessibility of the overriding method must match the security accessibility of the method being overriden.


    Any help on this is appreciated. 

    Thanks

    Madhu

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans