Troubleshooting steps to identify and resolve the crashing issue while monitoring applications in SharePoint/Multiple domain assembly environments

Troubleshooting steps to identify and resolve the crashing issue while monitoring applications in SharePoint/Multiple domain assembly environments

If you encounter the exception "Loading this assembly would produce a different grant set from other instances" while running the APM Insight .NET agent, follow these steps to identify and resolve the issue:

Understanding the issue

Our APM Insight .NET agent modifies IL code during it's runtime. Hence, the application must be run in full trust environments in single domain mode. In multiple domain scenarios, when the LoadOptimization is set to 2, issues may arise due to shared assembly and security configurations.

Identify the Crashing issue with Agent Logs

1. Navigate to C:\ProgramData\DotnetAgent\AgentLogs and open DotNetAgentManaged.ROOT.w3wp.<PID>-11-29-2023.log.
2. Look for exception entries like the example given below:

DotAgentManaged.ROOT.w3wp.<PID>-11-29-2023.log
  1. 12/27/2023 2:52:00 PM - [4:(DEBUG)<t:16>] - [TName: ]Creating root tracker.. 
  2. 12/27/2023 2:52:00 PM - [4:(DEBUG)<t:16>] - [TName: ]The uri is /Pages/default.aspx 
  3. 12/27/2023 2:52:00 PM - [4:(DEBUG)<t:16>] - [TName: ]Root tracker for the transaction DotNetAgent.Sequences.Sequence is System.ServiceModel.Channels.ServiceChannelProxy.InvokeService 
  4. 12/27/2023 2:52:00 PM - [4:(DEBUG)<t:16>] - [TName: ]Call stack count: 1 
  5. 12/27/2023 2:52:01 PM - [0:(CRITICAL)<t:16>] - Exception captured. An Error occurred during https://xxxxxxxxxx/Pages/default.aspx request/response. Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)
  6. 12/27/2023 2:52:01 PM - [4:(DEBUG)<t:16>] - [TName: ]Exception Tracker Created. 

Identify the Crashing issue with the Application Page

Check the application crashing page for exception information like the one in the image given below:


Identify the Crashing issue with Event Viewer logs

1. Open Event Viewer and navigate to Windows Logs -> Application.
2. Click the event with the source like Application Error or Microsoft-SharePoint products to verify the exception.


Solution

Notes
Note: These steps applicable from APM Insight .NET agent v6.7.2 or later. Kindly upgrade if your using older version.
1. Go to Start and click the Edit APM Insight .NET Agent Configuration tool to launch it

2. Enable the Support Multi-Domain Applications checkbox and Click Save.

3. Perform an IISRESET cmd execution to apply the changes.

If the issue persists, kindly contact support@manageengine.com along with the updated Agent diagnostics.

                  New to ADSelfService Plus?