Troubleshooting steps when there is an exception while monitoring ASP .NET applications.

Troubleshooting steps when there is an exception while monitoring ASP .NET applications.

Use Case:

Sometimes, you may receive the exception "Loading this assembly would produce a different grant set from other instances.", while running the APM Insight .NET agent in your ASP .NET applications.
This is because, by design, the agent works by modifying the IL code at runtime. Hence, it is required to run the application in full trust environments and in single domain mode. 

Solution : 
Follow the below steps to resolve the exception:
  1. Add   <trust level =”Full”/>    under the block in the application web.config file. In most cases, this will resolve the issue. If the issue is not resolved with this step, proceed to the next step.
  2. Set loader optimization to single domain mode. [Note: This second step is not recommended for Share Point applications.]
    1. For 64 bit applications:
      1. Open Registry Editor and navigate to the below path, "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework"
      2. Create a new registry DWORD value called "LoaderOptimization" and set the value as 1.
    2. For 32 bit applications:
      1. Open Registry Editor and navigate to the below path, "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework"
      2. Create a new registry DWORD value called "LoaderOptimization" and set the value as 1.
  3. Reset IIS and access your application. 


          • Related Articles

          • When there is an exception while monitoring ASP .NET applications.

            Use Case: Sometimes, you may receive the exception "Loading this assembly would produce a different grant set from other instances.", while running the APM Insight .NET agent in your ASP .NET applications. This is because, by design, the agent works ...
          • Troubleshooting steps for Server Hardware Health Monitoring

            1. SNMP Mode of monitoring: Monitoring Dell hardware status: Dell OpenManage Server Administrator and make sure SNMP agent is enabled Installation steps:  http://www.dell.com/downloads/global/power/ps2q06-20050112-Lou-OE.pdf Monitoring HP hardware ...
          • Ceph storage monitoring troubleshooting steps

            Ceph Storage Monitoring: By default Ceph monitor added via ssh. so ssh should be work if the customer want to monitor the Ceph storage for the server. Supported Ceph Storage Version : >= v0.66 Command used to collected all performance data :  ceph -s ...
          • Troubleshooting URL Monitor

            Here are few of the common errors you may come across in URL monitor, we have mentioned the steps you can follow to troubleshoot them.   General troubleshooting for URL monitor Ensure that the URL is accessible from the server in which Applications ...
          • Troubleshooting SSL Handshake Error

            SSL Handshake Error SSL Handshake error occurs when a secure connection cannot be established to the URL added for monitoring. Common reasons for it are wrong SSL protocol version, incompatible ciphers, and invalid/missing client-side certificate.  ...