Hi Amit
I sent this post a while ago, check if the suggestions help you identify the root cause
https://communities.ca.com/message/101036534
To summarize:
1. Check that combination of your Windows Os, IIS and CLR is supported
From APM Compatibility guides: https://support.ca.com/us/product-content/status/compatibility-matrix/application-performance-management-compatibility-guide.html
I see : windows 2012 r2 with IIS version 8(.net v4.5) and Windows 2012r2 with IIS version 8.5(.Net 4.7) as certified configurations
2. Check that the right Agent dll is in the GAC
3. Check for any permission issue
4. verify that Agent system variables have been created.
5. Look at the Windows Event viewer for Application log Error messages
Do you see any "Failed to CoCreate profiler"?
6. Check there is any not other profiler installed.
You can try to run: REG QUERY HKLM /f "COR_PROFILER" /s >> apm_netagent_regquery_corproofiler.txt
7. If you are using Ninject, ,manually update the .NET application configuration or implementation to use UseReflectionBasedInjection NinjectSetting. Make sure the reflection setting is added to all calls to the Kernel init, you would need to contact Ninject support
https://comm.support.ca.com/kb/_Using-older-versions-of-Ninject-with-Net-APM-agent-can-cause-InvalidProgramException-errors/KB000006555
8. If possible try to reinstall the agent.
It is strongly recommended to reboot the server if you have a previous version, after it has been uninstalled
9. For testing to isolate the issue, try to disable the .NET agent profiler by setting the system environment variable Cor_Enable_Profiling = 0x0 - This will ensure that the APM agent code is not invoked when .NET CLR is launched,
10. If the problem doesn't persist, enable back the profiler and try to set:
- introscope.nativeprofiler.clrv4.transparency.checks.disabled=true
- uncomment the following property and set it to true in the agent profile to use the generic trigger:
introscope.nativeprofiler.generic.agent.trigger.enabled=true
- Disable WCF/SOAP header insertion and additional WCF tracers in the webservices.pbd :
#TurnOn: WCFRuntimeTracing
#TurnOn: WebServicesCorrelationTracing
#TurnOn: WCFServerFaultTracing
#TurnOn: WCFClientFaultTracing
#TurnOn: WCFServerTracing
#TurnOn: WCFClientTracing
- stop the Windows Perfmon collector service
restart IIS and verify the issue.
11. If the problem persists gather the below diagnostic files and open a case with CA Support
-Enable DEBUG logging in the logging.config.xml and set introscope.nativeprofiler.logBytecode=true and introscope.nativeprofiler.logAllMethodsNoticed=true in the IntroscopeAgent.profile and reproduce the issue.
-Use Debug Diagnostics Tool from Microsoft to capture user dump, which contains both heap and thread snapshots. The following KB has both a download link and usage instructions: http://support.microsoft.com/kb/2580960
I hope this helps,
Regards,
Sergio