Install - .NET Core Windows Dynamic Agent started as an IIS Site


.NET Core Compatibility

vFunction supports C# .NET Core versions 3.0, 6.0. 7.0, 8.0 applications.


Application Pool Prerequisites

The vFunction Agent requires a distinct Application Pool to be created for the Application if the current Application Pool is used by multiple Applications. Follow these steps to create a new Application Pool if needed.


Installation Workflow

  1. Ensure Prerequisites are met
  2. Download the vFunction Windows Controller Installation ZIP
  3. RDP to the Windows Server as the user who runs the Application
  4. Move the Installation ZIP to the location on the Windows Server where vFunction should run
  5. Extract the vFunction Installation Package

Path #1: Use Environment Variables to set the vFunction Configurable Settings
  1. Open PowerShell
  2. Optional: Add Environment Variables for the vFunction Dynamic Agent and install the Agent
### Replace the $CHANGE_ME values with the Required Configuration Settings. For detailed Settings explanations, see:
### https://kb.vfunction.com/installations/configurable-settings/mono-dynamic-agent/dotnet/windows/#required
### Replace $BASE_DIR with the Windows location where the vFunction Installation ZIP was extracted
dir -Path "$BASE_DIR\vfunction" -Recurse | Unblock-File

powershell -NoProfile -ExecutionPolicy unrestricted -Command "
New-Item -Path Env:\VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_NAME -Value '$CHANGE_ME';
New-Item -Path Env:\VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_HOST -Value '$CHANGE_ME';
New-Item -Path Env:\VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_APP_ID -Value '$CHANGE_ME';
New-Item -Path Env:\VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_ORG_ID -Value '$CHANGE_ME';
New-Item -Path Env:\VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_CLIENT_ID -Value '$CHANGE_ME';
New-Item -Path Env:\VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_CLIENT_SECRET -Value '$CHANGE_ME';
New-Item -Path Env:\VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_INSTANCE_ID -Value '$CHANGE_ME';
New-Item -Path Env:\VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_TAG -Value '$CHANGE_ME';
New-Item -Path Env:\VF_CONTROLLER_DEFAULT_DOTNET_AGENT_VERSION -Value 'dotnet';
New-Item -Path Env:\VF_CONTROLLER_DEFAULT_DOTNET_AGENT_ENVIRONMENT -Value 'iis';
$BASE_DIR\controller-installation\install.ps1 -instance default-dotnet -scriptMode true"

Path #2: Use a YAML to set the vFunction Configurable Settings
  1. Open $BASE_DIR\vfunction\config\installation\instances\default-dotnet\installation.yaml and set the Configurable Settings
### See https://kb.vfunction.com/installations/configurable-settings/mono-dynamic-agent/dotnet/windows/ for Required and Optional Configurable Settings
controller:
  name: qa-app1 ### This is an identifier in the VF Server UI to help locate the desired Agent
  host: http://10.0.0.1 ### This is the VF Server's Address
  org_id: 1111-11-11-1111 ### This is taken from the VF Server UI's Installation Instruction dialog box
  app_id: 1111-11-11-1111 ### This is taken from the VF Server UI's Installation Instruction dialog box
  client_id: 1111-11-11-1111 ### This is taken from the VF Server UI's Installation Instruction dialog box
  client_secret: 1111-11-11-1111 ### This is taken from the VF Server UI's Installation Instruction dialog box
  type: dotnet
  instance_id: qa-app1-instance_id ### This is useful if the App restarts regularly for cleanliness in the VF Server UI
  instrconf_additions:
    inclusions:
#      - a.b.c.
    exclusions:
#      - a.b.c.
  tags: ### This is useful for Learning across a number of Agents simultaneously
    - qa
    - app1

server_application:
#  name:
#  include_classes: com.
#  allowed_users:
#  new_user_default_password:

agent:
  # optional versions: framework, dotnet
  version: dotnet
  # optional environments: iis, service, command
  environment: iis
#  application_name:
#  architecture: x86
#  application_command:
### Set the log level for the agent (trace, debug, info, warning, error, critical). The default is debug.
#  log_level: info
#  enable_rejit: true
  1. Open PowerShell and install the vFunction Agent
### Replace $BASE_DIR with the Windows location where the vFunction Installation ZIP was extracted
dir -Path "$BASE_DIR\vfunction" -Recurse | Unblock-File

powershell -NoProfile -ExecutionPolicy unrestricted -Command "$BASE_DIR\controller-installation\install.ps1 -instance default-dotnet -scriptMode true"

  1. Open the C:\Windows\System32\inetsrv\config\applicationHost.config to create the Environment Variables that hook the vFunction Dynamic Agent into the Application
  2. Search for the term applicationPools in the applicationHost.config. Find the relevant Application Pool, such as DefaultAppPool, to be modified
### Replace $BASE_DIR with the Windows location where the vFunction Installation ZIP was extracted
    <add name="DefaultAppPool" autoStart="true">
        <environmentVariables>
            <add name="VF_AGENT_CONF_LOCATION" value="$BASE_DIR\config\agent\instances\default-dotnet\conf.json" />
            <add name="CORECLR_PROFILER_PATH_64" value="$BASE_DIR\agent\vfagent.net.dll" />
            <add name="CORECLR_PROFILER_PATH_32" value="$BASE_DIR\agent\vfagent.net.x86.dll" />
            <add name="CORECLR_ENABLE_PROFILING" value="1" />
            <add name="CORECLR_PROFILER" value="{cd7d4b53-96c8-4552-9c11-6e41df8eab8a}" />
            <add name="DOTNET_TailCallOpt" value="0"/>
        </environmentVariables>
    </add>
  1. Recycle the relevant Application Pool from IIS Manager to affect only this Site. Or, run iisreset to restart all Sites
  2. Confirm that the Application comes up and functions as expected. If any issues arise:
  1. Start Learning in the vFunction UI
  2. Validate the vFunction data collectioncollecting data