# Scanning the build binaries

The SeaLights .NET agent can scan the binaries after the build process to gather the build structure.

## Generating a session ID <a href="#generating-a-session-id" id="generating-a-session-id"></a>

Before running the build scan and tests, you need to create a session ID. The session ID is provided for each step to link them together as one complete cycle

{% code overflow="wrap" %}

```powershell
SL.DotNet config --appName "myApp" --branchName "master" --buildName $BUILD_VERSION --includeNamespace myNameSpace.* --buildSessionIdFile buildSessionId.txt --identifyMethodsByFqn
```

{% endcode %}

{% hint style="warning" %}
The above parameter `buildName` should reflect a meaningful versioning of your service or application.\
\
In some cases, you can use timestamps as well, via commands like `$(date +"%y%m%d_%H%M")` (Linux) or `"%date:~10,4%%date:~4,2%%date:~7,2%_%time: =0:~0,4%"` (Windows CMD) or `$(Get-Date -Format "yyyyMMdd_HHmm")` (Powershell)
{% endhint %}

## Scanning the binaries <a href="#scanning-the-binaries" id="scanning-the-binaries"></a>

Run the scan of your binaries using the SeaLights agent with the following command:

{% code overflow="wrap" %}

```
SL.DotNet scan --buildSessionIdFile buildSessionId.txt --binDir c:\path\to\binaries --ignoreGeneratedCode true
```

{% endcode %}

{% hint style="warning" %}
The `binDir` folder must contain all the project’s PDB files.
{% endhint %}

{% hint style="info" %}
See [Command Reference](/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/.net-core-agent/command-reference.md) for full parameter details
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/.net-core-agent/scanning-the-build-binaries.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
