Installing Lightrun .NET agent on IIS¶
You can install the Lightrun .NET agent on the IIS (Internet Information Services) framework, a flexible, secure, and manageable web server designed for hosting web apps.
Follow the initial instructions for installing the agent using the Lightrun NuGet package, as outlined in the .NET Installation. Subsequently, proceed with the following steps to set the required environment variables, bearing in mind that this process differs in IIS and involves additional configuration steps for the application pool.
Note
In IIS, each web application belongs to an Application Pool
. To debug an IIS application, the corresponding Application Pool
must contain only that application. This limitation arises because debugging is enabled for the entire Application Pool
, and other web application won't function properly without the Lightrun
agent.
Configuring the application pool in IIS¶
- Open the IIS Manager and select
Configuration Editor
. - Select the
system.applicationHost/applicationPools
section. -
Locate the required
Application Pool
to update its environment variables.The environment variables differ for .NET Core and .Net Framework.
-
Proceed to set the environment variables based on their respective types.
Set .NET Core environment variables¶
The .NET Core environment variables include the CORCLR_
prefix and should be set as follows:
CORCLR_ENABLE_PROFILING=1
CORCLR_PROFILER={FC15CFC2-6CE8-45DF-A754-079254E0077B}
CORCLR_PROFILER_PATH_64=PUBLISH_DIRECTORY\lightrun\win-x64\Lightrun.ClrProfiler.Native.dll
CORCLR_PROFILER_PATH_32=PUBLISH_DIRECTORY\lightrun\win-x86\Lightrun.ClrProfiler.Native.dll
Important
PUBLISH_DIRECTORY
should be changed to the actual directory where the web application is published.
Set .NET Framework environment variables¶
To initialize the Lightrun agent in .Net Framework, set the processModel/loadUserProfile
property to True
.
The .Net Framework environment variables include the COR_
prefix and should be set as follows:
COR_ENABLE_PROFILING=1
COR_PROFILER={FC15CFC2-6CE8-45DF-A754-079254E0077B}
COR_PROFILER_PATH_64=PUBLISH_DIRECTORY\lightrun\win-x64\Lightrun.ClrProfiler.Native.dll
COR_PROFILER_PATH_32=PUBLISH_DIRECTORY\lightrun\win-x86\Lightrun.ClrProfiler.Native.dll
Important
PUBLISH_DIRECTORY
should be changed to the actual directory where the web app is published.
Note
Applicable only to .NET agent versions lower than 1.36.3.
DebugType
should be set to embedded.
Locating PDB files works differently for .Net Framework apps on IIS.
Make sure your project file (.csproj
) includes the following:
<PropertyGroup>
<DebugType>embedded</DebugType>
</PropertyGroup>