Install - .NET Core Agent Startup Parameters on Windows started as a Service for Dynamic Analysis



.NET Core Compatibility

vFunction supports C# .NET Core version 3.x and .NET 6.x, 7.x and 8.x applications.


Installation Workflow

  1. Install the Dynamic Analysis Controller
  2. Open the vFunction .NET Core Windows Service startup parameters in a text editor

    ### Replace the REPLACE_BASE_DIR below with the actual value, such as C:\vfunction
    ### Replace the INSTANCE_NAME below with the actual value, such as default-dotnet

    REPLACE_BASE_DIR\config\agent\instances\INSTANCE_NAME\vmargs-examples\windows-service
  3. Open the Windows Server's Registry Editor
    • Open the Start Menu
    • Search for regedit
    • Launch the Registry Editor
  4. In the left-hand sidebar, expand the folders to get to Application

    ### Replace the SERVICE_NAME below with the name of the Windows Service for the Application

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SERVICE_NAME
  5. Right-click in the white space below the list of Registry Keys for the Service
  6. Select New > >Multi-String Value
  7. Replace New Value #1 with Environment
  8. Double-click the new Environment variable to add Value Data entries
  9. Copy-and-paste all of the Value Data strings from your text editor (from Step #2) into the Edit Multi-String Value Data text box
  10. Click the OK button
  11. Restart the Windows Service
  12. Confirm that the Application comes up and functions as expected
  13. If any issues arise:

Sample contents of vmargs-example/windows-services file

Open the sample file in:

### Replace the REPLACE_BASE_DIR below with the actual values, such as C:\vfunction\

REPLACE_BASE_DIR\controller-installation\stuff\agent\vmargs-examples\dotnet\dotnet\windows-services

The contents of this sample file are below:

### Replace the REPLACE_BASE_DIR below with the actual values, such as C:\vfunction\
### Replace the REPLACE_INSTANCE below with the actual values, such as default-dotnet
Each windows service has a key in the registry at:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<ServiceName>.

Under this key, we can set a multi string value called Environment and add all the relevant vars to it:

Value Name:
  Environment

Value Data:
  VF_AGENT_CONF_LOCATION=REPLACE_BASE_DIR\config\agent\instances\REPLACE_INSTANCE\conf.json
  CORECLR_PROFILER_PATH_64=REPLACE_BASE_DIR\agent\vfagent.net.dll
  CORECLR_PROFILER_PATH_32=REPLACE_BASE_DIR\agent\vfagent.net.x86.dll
  CORECLR_ENABLE_PROFILING=1
  CORECLR_PROFILER={cd7d4b53-96c8-4552-9c11-6e41df8eab8a}
  DOTNET_TailCallOpt=0

Or, alternatively. once the install script is run, the relevant placeholder fields in the file are replaced in the version of the environmentally-specific file in:

### Replace the REPLACE_BASE_DIR below with the actual values, such as C:\vfunction\
### Replace the INSTANCE_NAME below with the actual values, such as default-dotnet

REPLACE_BASE_DIR\config\agent\instances\INSTANCE_NAME\vmargs-examples\windows-services