cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Cody.Naumann
AppDynamics Team (Retired)

Problem

 

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 System.Net.HttpWebRequest.GetRequestStream()

   at AppDynamics.Shared.Communication.qe.ju(Byte[ ] , String )

   at com.appdynamics.ee.rest.controller.request.av.kkw()

 

Choose the solution that best fits your environment, below.

 

Modify the SharePoint application web.config

 

  1. Check the value of the legacyCasModel attribute of the trust element in the SharePoint web.config:
    <trust level="Full" originUrl="" legacyCasModel="true" />
  2. If legacyCasModelis set to "true," then change it to "false".
  3. Save the web.config file.
  4. Restart IIS.
  5. 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:

 

  1. 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. 
  2. Configure the following registry settings:
  3. Under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework
  4. Create new DWORD "LoaderOptimization" with value 1
  5. Under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\
  6. Create new DWORD "LoaderOptimization" with value 1
    This configuration disables loader optimization assemblies that caused this issue.
  7. Restart the Appdynamics.Agent.Coordinator service.
  8. Restart IIS.

add-assembly-reference

Microsoft Sharepoint with .NET agent version 4.3.2 - 4.4.

 

add-assembly-reference is set to false out of the box, and must be set to true.

 

add-assembly-reference adds the AppDynamics.Agent.dll as a dependency of all loaded assembles, so that when instrumented code calls the AppDynamics.Agent.dll, the .NET agent doesn't think the call has transitioned to an untrusted dependency.

 

Add the following information to config.xml under the app-agents element as the first child. Then, restart the coordinator service and your instrumented application.

 

<profiler>
        <add-assembly-reference enabled="true" />
    </profiler>

 

After restarting the coordinator service and your instrumented application, test the application to make sure everything works as expected. If the above change does not work, implement a global registry change.

 

Microsoft Sharepoint with .NET agent version 4.4.x or later

 

If you are running Microsoft Sharepoint with .NET agent version 4.4.x or later, you can skip using add-assembly-reference and just turn on full-no-dependency-mode in your config.xml file:

 

 

<?xml version="1.0" encoding="utf-8" ?>
<appdynamics-agent><app-agents><profiler>
<full-no-dependency-mode enabled="true" />
</profiler>
</app-agents></appdynamics-agent>

 

Version history
Last update:
‎04-20-2018 10:56 AM
Updated by:
On-Demand Webinar
Discover new Splunk integrations and AI innovations for Cisco AppDynamics.


Register Now!

Observe and Explore
Dive into our Community Blog for the Latest Insights and Updates!


Read the blog here
Contributors