# Start and stop the .NET Framework agent

To start the agent, and enable analysis, use one of these options:

1. Select Windows Start > Services, then right-click on Contrast.NET Main Service and select Start.

2. From an administrator command prompt, use:

net start DotnetAgentSvc

### Note

By default, the Contrast .NET Main Service is set to Startup Type: Automatic (Delayed Start). This means it automatically starts, either during installation or when Windows starts.

To stop the agent, and consequently disable Contrast instrumentation and analysis, use one of these options:

1. Select Windows Start > Services, then right-click on Contrast.NET Main Service and select Stop.

2. From an administrator command prompt, use:

net stop DotnetAgentSvc

### Important

Contrast automatically restarts IIS when you install the agent as well as any time that the .NET agent is stopped or started.

The .NET Profiling API requires that profiled processes be started with a profiler. Therefore, the .NET agent must restart IIS (and any IIS worker processes) to attach the Contrast profiler. This process is similar to how other profiling products (for example, memory or performance profilers) behave.

You may want to change the configuration of any web server monitoring tools that raise alarms when IIS restarts.

The .NET agent restarts IIS by stopping the Windows Process Activation Service (WAS), and then starts any previously running services that are dependent on WAS, such as World Wide Web Publishing Service (W3SVC). In some cases, users needed to manually configure service dependencies so that WAS-dependent services restart with IIS (for example, MSMQ Listener Adapter).