Install - .NET Framework Windows Dynamic Agent hooked via Environment Variables


.NET Framework Compatibility

vFunction supports C# .NET Framework version 4.x applications.


Disclaimer about Environment Variables

If using Environment Variables to hook the .NET Application, vFunction will try to hook into every started process on the machine. You will need to tell the vFunction Agent to match only the desired process and drop out of every other process. Note that Step #7 of the Installation Workflow includes a reference to the Application Name which will need to match the Command Line entry to run the Application. You may want to use Process Explorer to get an entry that can be copied. More details about this vFunction Settings are here.


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
  6. Open PowerShell
  7. 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
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_SERVER_APPLICATION_SERVER_USERNAME -Value '$CHANGE_ME';
New-Item -Path Env:\VF_CONTROLLER_DEFAULT_DOTNET_SERVER_APPLICATION_SERVER_PASSWORD -Value '$CHANGE_ME';
New-Item -Path Env:\VF_CONTROLLER_DEFAULT_DOTNET_SERVER_APPLICATION_NAME -Value '$CHANGE_ME';
New-Item -Path Env:\VF_CONTROLLER_DEFAULT_DOTNET_SERVER_APPLICATION_INCLUDE_CLASSES -Value '$CHANGE_ME';
New-Item -Path Env:\VF_CONTROLLER_DEFAULT_DOTNET_AGENT_APPLICATION_NAME -Value '$CHANGE_ME';
$BASE_DIR\controller-installation\install.ps1 -instance default-dotnet -scriptMode true"
  1. Create the Environment Variables that hook the vFunction Dynamic Agent into the Application
### Replace $BASE_DIR with the Windows location where the vFunction Installation ZIP was extracted
[Environment]::SetEnvironmentVariable("VF_AGENT_CONF_LOCATION", "$BASE_DIR\config\agent\instances\default-dotnet\conf.json", "User")
[Environment]::SetEnvironmentVariable("COR_PROFILER_PATH_64", "$BASE_DIR\agent\vfagent.net.dll", "User")
[Environment]::SetEnvironmentVariable("COR_PROFILER_PATH_32", "$BASE_DIR\agent\vfagent.net.x86.dll", "User")
[Environment]::SetEnvironmentVariable("COR_ENABLE_PROFILING", "1", "User")
[Environment]::SetEnvironmentVariable("COR_PROFILER", "{cd7d4b53-96c8-4552-9c11-6e41df8eab8a}", "User")
[Environment]::SetEnvironmentVariable("COMPlus_TailCallOpt", "0", "User")
  1. Start or Restart the .NET Application
  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