.NET Framework agent installer for Windows
The Contrast .NET Framework agent installer is a normal Windows application installer built using standard MSI technology. It validates that the target server satisfies several requirements (for example, that the server's operating system is a supported operating system). If all requirements are met, the installer:
Registers the .NET Framework agent as a standard Windows program.
Places the agent’s files on a disk in the specified install location (for example, C:\Program Files\Contrast\dotnet). This includes several dynamic link libraries (DLLs) and executables, such as the background Windows service that drives agent behavior.
Creates the specified data directory for the agent that's primarily used to store agent log files and configuration (for example, C:\ProgramData\Contrast\dotnet).
Registers the agent’s background Window service with the operating system.
Adds the agent's Native Module to IIS. The Native Module registers the agent’s profiler component with IIS through environment variables. This causes the CLR to load the agent’s profiler, which is responsible for instrumenting analyzed applications.
Starts the agent’s background Windows service and Contrast tray application. This service is responsible for:
Communication with profiler and sensor components through local named pipes.
Note
If you are using the agent with self-hosted Web API and OWIN (outside of IIS), further configuration is needed.
If you are using Windows 2008, a version of .NET Framework prior to 4.7.1 or if your application targets CLR2, you should use the Legacy .NET Framework agent installer.
Install the .NET Framework agent using Contrast:
Install the .NET Framework agent using Contrast
In the Contrast web application, select Add new in the top right.
Select the Application card.
Choose .NET Framework in the application language dropdown, then select IIS hosted and select the link to Download the agent and YAML configuration file.
Extract the downloaded ZIP archive on the web server, and run ContrastSetup.exe. This installs the .NET Framework agent.
The contrast_security.yaml file is copied to the agent's data directory by the installer and placed in C:\ProgramData\Contrast\dotnet\contrast_security.yaml by default. The installer does not copy the YAML file if it already exists at the destination.
You can use the command line to access additional options supported by the .NET Framework agent installer for Windows.
If you are using another profiler in this environment, such as an APM like New Relic or AppDynamics, then you need to enable Contrast profiler chaining.
You can further configure the agent using the .NET Framework YAML template.
Use the application as you normally would and verify that Contrast sees your application.
If there are some applications you don't need to analyze, or if you are trying to be lean on performance, consider using application pools to limit the number of applications instrumented.
Install the .NET Framework agent using command line
You can use the command line to access additional options supported by the .NET Framework agent installer for Windows.
The .NET agent can be installed using the Windows UI, and uninstalled or repaired using standard Windows features (including the Programs and Features Control Panel and Powershell). However, you may want to use the .NET Framework agent installer for Windows to perform these actions instead for certain scenarios such as automated scripting.
Use these commands for attended mode:
Install:
ContrastSetup.exe
Uninstall:
ContrastSetup.exe -uninstall
Repair:
ContrastSetup.exe -repair
Use these commands for unattended or silent mode:
Install:
ContrastSetup.exe -s -norestart
Uninstall:
ContrastSetup.exe -uninstall -s -norestart
Repair:
ContrastSetup.exe -repair -s -norestart
The .NET Framework agent installer for Windows supports several additional options that are accessible when you use the command line for installation.
Option | Description | Example |
---|---|---|
| This option specifies the install directory. Program files will be written to this directory. Defaults are dependent on OS variables. |
|
| This option specifies the directory for Agent Explorer files. |
|
| This option specifies the data directory. Logs and the |
|
| This option specifies a custom YAML configuration file. The default value is the contrast_security.yaml file located relative to the installer's location. |
|
| This option is required when you install, upgrade, and repair the agent. If you set the value to |
|
| This option is required when you install, upgrade, and repair the agent. If you set the value to |
|
| If you set the value of this option to The default value is Note
|
|
| Run the agent service under a restricted virtual service account. Configures the service to run as the |
|
| Restrict edits to the |
|
| If you don't want to install the Agent Explorer, set the value for this option to The default value is |
|
| If you don't want to install the agent upgrade service, set the value of this option to |
|
| This option specifies the directory for the upgrade service files. |
|
Tip
To install the .NET agent using scripts, you can use this command:
ContrastSetup.exe -s PathToYaml=C:\Temp\custom.yaml
This command installs the .NET agent in silent and unattended mode and uses a custom path to the YAML configuration file.
Important
Contrast automatically restarts IIS when you install the agent.