.Net/.NetCore - I don't know what namespace to configure

Problem

The SeaLights build scan needs the namespaces to focus the scan only on your code and not include third-party code. Sometimes, you don't know what the relevant namespace is.

Solution

Use a Microsoft tool to identify the content of your DLLs/EXE files: https://learn.microsoft.com/en-us/dotnet/framework/tools/ildasm-exe-il-disassembler

The IL Disassembler is a companion tool to the IL Assembler (Ilasm.exe). Ildasm.exe takes a portable executable (PE) file that contains intermediate language (IL) code and creates a text file suitable as input to Ilasm.exe.
This tool is automatically installed with Visual Studio.

Use ildasm.exe component_name.dll where component_name.dll is the file name of your artifact. This will display the namespace, classes, and all the methods in it.

Sample result

From the right side of the screenshot, you understand you need to provide --namespace ILDASMDemo.* to the Sealights .Net agent.

image-20240512-080627.png

 

Related articles