Deploying AcuSensor for ASP .NET Core

IMPORTANT:

  • .NET AcuSensor supports .Net Core 6 and .Net Core 8 (beta)
  • AcuSensor utilizes the AcuSensor Bridge. To learn more about the AcuSensor Bridge, refer to our AcuSensor Bridge documentation.

Deploying AcuSensor for ASP .NET Core websites

The AcuSensor agent must be deployed to your web application. This section describes how to deploy AcuSensor to an ASP.NET Core web application.

Prepare the .NET Core AcuSensor

  1. Download the .NET AcuSensor file for your target. For instructions, refer to Installing AcuSensor.
  2. Create a folder that will host your AcuSensor files. In this example, we have used a folder called C:\acusensor.
  3. Extract the files from the downloaded dotnet-acusensor.zip file to another destination folder.
  4. Navigate to the destination folder and open the .NET Core subfolder.
  5. Select and copy all the items inside the subfolder.

  1. Navigate to the folder you created in Step 2 above (in our example C:\acusensor).
  2. Paste into the folder the files you copied in Step 5 above.

Deploying into a Kestrel .NET Core website

  1. Navigate to your web application root folder.

  1. Create a new sitelauncher.bat file inside your web application root folder with the following contents (replacing axexample-dotnetcore.exe with the name of the executable file for your web application):

SET SENSOR_SETTINGS_PATH=C:/acusensor/settings.ini

SET DOTNET_STARTUP_HOOKS=C:/acusensor/InvictiSensor.dll

axexample-dotnetcore.exe --urls http://0.0.0.0:80

  1. From the command line, navigate to your web application root folder and launch your web application.

Deploying into a Kestrel .NET Core website on Linux

  1. Navigate to your web application root folder.
  2. Create a new sitelauncher.sh file inside your web application root folder with the following contents (replacing axexample-dotnetcore.dll with the name of the executable file for your web application):

#!/bin/bash

export DOTNET_STARTUP_HOOKS="/acusensor/InvictiSensor.dll"

export SENSOR_SETTINGS_PATH="/acusensor/settings.ini"

dotnet ./axexample-dotnetcore.dll --urls "http://0.0.0.0:80"

  1. From the command line, navigate to your web application root folder and launch your web application

Deploying into an IIS .NET Core website

  1. Navigate to your web application root folder.

  1. Edit your web.config file to add environment variables for using AcuSensor:

<?xml version="1.0" encoding="utf-8"?>

<configuration>

  <location path="." inheritInChildApplications="false">

    <system.webServer>

      <handlers>

        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />

      </handlers>

      <aspNetCore processPath="dotnet" arguments=".\axexample-dotnetcore.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess">

        <environmentVariables>

<environmentVariable name="DOTNET_STARTUP_HOOKS" value="C:/acusensor/InvictiSensor.dll" />

          <environmentVariable name="SENSOR_SETTINGS_PATH" value="C:/acusensor/settings.ini" />

        </environmentVariables>

      </aspNetCore>

    </system.webServer>

  </location>

</configuration>

<!--ProjectGuid: 16505b2e-7499-4c97-a9ff-d18e39913ad5-->

  1. Restart your web application from IIS Manager.

 

« Back to the Acunetix Support Page