In order for .NET Memory Profiler and the NmpCore tool to attach to a process using the profiling API, the process must be running under .NET Framework 4.0. Additionally, the concurrent garbage collector must not be enabled. This is normally not a problem when attaching to server processes (like ASP.NET running under IIS), since they are using the server garbage collector, which is not using concurrent GC. For a standalone program, the concurrent garbage collector can be disabled by modifying the application config file. To disable concurrent GC and run the program under .NET Framework 4.0, modify the config file so that it includes the following settings:
<?xml version="1.0"?>
<configuration>
<runtime>
<gcConcurrent enabled="false" />
</runtime>
<startup>
<supportedRuntime version="v4.0.30319" />
</startup>
</configuration>