Current versions of the .NET profiler require that CLR version 2 activation policy is being used. If the target program has been compiled targeting CLR version 4, and version 2 activation policy has not been enabled, the instrumentation will fail with the above errors.
CLR version 2 activation policy can be enabled by modifying the exe.config file startup block for the application to include the needed activation policy. The format of the change varies depending on the targeted framework.
For Framework 4.0, both the addition of the useLegacyV2RuntimeActivationPolicy attribute to the startup element, and the inclusion of a Profile attribute in the supportedruntime element are required. For example:
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>
</startup>
For Framework 4.5 and later, the Profile attribute should not be included:
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>