Search This Blog

Tuesday 17 September 2019

BizTalk: Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)

Hi BizTalk Buddies,

Hope you are all doing great. Time for another Article.

As we all know that the BizTalk host can either be 32-bit or 64-bit and our host instances run on those hosts. 

As we might also know, 
Running the FTP adapter, POP3 adapter, and MIME Decoder on 64-bit host instances is not supported. We can only run them on 32-bit host instances.

Errors in the event viewer:-
There was a failure executing the send pipeline: "Microsoft.BizTalk.DefaultPipelines.XMLTransmit, Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "XML assembler" Send Port: "sendPortName" URI: "mssql://xxxxServerName//xxxxDBName?" Reason: Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)


A message sent to adapter "WCF-SQL" on send port "sendPortName" with URI "mssql://xxxxServerName//xxxxDBName?" is suspended. 
 Error details: There was a failure executing the send pipeline: "Microsoft.BizTalk.DefaultPipelines.XMLTransmit, Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "XML assembler" Send Port: "xxxYourSendPortName" URI: "mssql://ltvmanchikanti//Insurance_Collections?" Reason: Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)  
 MessageId:  {934486D4-5F64-4EED-BBE8-E68A5F5DDBA8}
 InstanceID: {C78702BB-4DFE-412B-98F9-AAD347660ACC}


There was a failure executing the response(receive) pipeline: "Microsoft.BizTalk.DefaultPipelines.XMLReceive, Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "XML disassembler" Send Port: "xxxYourSendPortName" URI: "mssql://xxxxServerName//xxxxDBName?" Reason: Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)

Reason:- The reason why we are getting the above errors is that our send adapter hander on the port where we get an error is running on a 32-bit host as opposed to 64-bit.

NB: Normally this happens when we use default host(BizTalkServerApplication which might be a 32-bit host) that gets created when BizTalk is installed.

Solution Steps:- 

  • We must create the host with 32-bit only checkbox un-checked as shown below.
  • Create the send/receive handler on the Adapter(in my Case WCF-SQL but the principle is same for other adapters that run on the 64-bit host) that we have experienceing the issue on.
  • Select the adapter handler that is created in the above step as shown below.

Sending Email to Multiple recipients using PowerShell

Hi All,  Below is the working code to Send emails to Multiple recipients using PowerShell. [STRING]$PSEmailServer = "YourSMTPServerIPOr...