In some instances, you may need to perform additional configuration to properly instrument Microsoft SharePoint sites with the AppDynamics .NET Agent.
If you are running Microsoft SharePoint with .NET Framework 4.5.2 or 4.6 and later, the .NET Agent automatically instruments SharePoint without configuration changes to SharePoint.
If you suspect you are having issues instrumenting SharePoint sites with the .NET Agent, check the agent log (AgentLog.txt) for entries as follows:
2015-05-13 17:38:18.9799 13436 w3wp 2 26 Error ConfigurationChannel Exception: Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)Exception: System.IO.FileLoadException: Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)
at AppDynamics.Shared.Communication.qe.ju(Byte[ ] , String )
Choose the solution that best fits your environment, below.
Modify the SharePoint application web.config
Check the value of the legacyCasModel attribute of the trust element in the SharePoint web.config: <trust level="Full" originUrl="" legacyCasModel="true" />
If legacyCasModelis set to "true," then change it to "false".
Save the web.config file.
Confirm your application continues to work normally.
If, for any reason, setting legacyCasModel to "false" is not possible, use the option below to modify the registry.
Global registry change
Microsoft has provided the following workaround for this issue:
Back up the .NET agent Logs directory (for example, %ProgramData%\AppDynamics\DotNetAgent\Logs) and remove its contents, but be sure to retain the Logs directory itself.
Configure the following registry settings:
Create new DWORD "LoaderOptimization" with value 1
Create new DWORD "LoaderOptimization" with value 1 This configuration disables loader optimization assemblies that caused this issue.
Restart the Appdynamics.Agent.Coordinator service.