How do I turn off Concurrent Garbage Collection?

.net, c#

Solution

Modify or create an App.Config file and set the following code

<configuration>
   <runtime>
       <gcConcurrent enabled="false"/>
   </runtime>
</configuration>

This is from MSDN: How to: Disable Concurrent Garbage Collection. For more information on creating an App.Config look here

Problem

I'm trying to run Microsoft's CLR Profiler on an application of ours. It's a C#/.Net 4.0 app which controls industrial machinery at factories. Microsoft's CLR Profiler dramatically slows down the target applications (10X to 100X, according to its author, Peter Sollich). In our case it slows down our app so much that it fails because the network equipment our app is talking-to times out during the lengthy process when the program first starts up of establishing connections with devices on the factory floor. So what I want to do is start our app and let it finish its initialization and THEN attach the profiler. When I try that CLR Profiler says I have to "Turn off concurrent GC in the application's configuration file" for that to work. Where exactly is the setting it's referring to? What is the configuration file and how can I access the setting in Visual Studio 2010?

Original source