How to fix "module was not instrumented." Reason:"path_is_excluded" error in Microsoft.CodeCoverage.Console tool?

R M 20 Reputation points
2024-06-13T06:50:10.2966667+00:00

I'm receiving the following problem while trying to instrument my dll with Microsoft.CodeCoverage.Console tool. module was not instrumented. Reason: path_is_excluded."

I'm using Microsoft.CodeCoverage.A console tool for calculating code coverage. When I execute the instrument command with my dll, I receive the message module was not instrumented. Reason: path_is_excluded.

I absorbed the dll that ends with Clr, and the error is being generated.

(Example: MyProjectClr.dll, MyProject.CLR.dll)

Even I tried the following .runsettings file

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

<RunSettings>

<DataCollectionRunSettings>

<DataCollectors>

<DataCollector friendlyName="Code Coverage">

<Configuration>

<CodeCoverage>

<ModulePaths>

<Include>

<!-- Include all DLLs -->

<ModulePath>.*</ModulePath>

<!-- Explicitly include DLLs ending with CLR.dll -->

<ModulePath>.*CLR.dll$</ModulePath>

</Include>

</ModulePaths>

</CodeCoverage>

</Configuration>

</DataCollector>

</DataCollectors>

</DataCollectionRunSettings>

</RunSettings>

It is not working. What has to be done to resolve this issue?

i am using VS 2022 Enterprise edition and dll and pdb patched properly. remaining all dlls which not end with the name CLR its working fine

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,560 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,813 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,607 questions
Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
336 questions
{count} votes

0 additional answers

Sort by: Most helpful