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:
- 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.
-
Set loader optimization to single domain mode. [Note: This second step is not recommended for Share Point applications.]
- For 64 bit applications:
- Open Registry Editor and navigate to the below path, "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework"
- Create a new registry DWORD value called "LoaderOptimization" and set the value as 1.
- For 32 bit applications:
- Open Registry Editor and navigate to the below path, "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework"
- Create a new registry DWORD value called "LoaderOptimization" and set the value as 1.
- Reset IIS and access your application.
Related Articles
How to identify and resolve conflicts between other APM products and the APM Insight .NET agent
Problem statement: You are experiencing either of the below issues and suspect that another APM product is interfering with the Site24x7 .NET agent. 1. The .NET monitor is not created under APM > APM Insight > Applications, even after the .NET agent ...
How to uninstall the Site24x7 Windows Server Monitoring Agent
Method 1: To uninstall the Site24x7 Windows Server Monitoring Agent, click the link below: https://staticdownloads.site24x7.com/server/Site24x7WindowsAgentUninstall.zip Unzip and execute the Uninstall.bat file in the Command Prompt as an ...
Troubleshooting false positive alerts in monitoring
Problem False positive alerts are being generated. Possible cause The monitoring system is down in some locations. The Website monitor might be configured for one location, such as Seattle, but may appear down when accessed from another location, ...
Bundled .NET and .NET Core agents in a single MSI
In APM Insight .NET agent version 6.8.0, the .NET and .NET Core agents have been bundled into a single MSI, enabling unified monitoring of both application types. Upgrade requirements for .NET Core agent 6.7 and below If you're using .NET Core agent ...
Synthetic browser module prerequisite and troubleshooting guide for On-Premise Pollers
Introduction This document provides a structured troubleshooting guide for resolving issues encountered during the download process of On-Premise Poller for Synthetic (Browser) Module. It covers possible statuses, check-up steps, remedies, and ...