Hello, please try change <ModulePaths> to <ModulePaths mergeDefaults="false"> in .runsettings file.
How to fix "module was not instrumented." Reason:"path_is_excluded" error in Microsoft.CodeCoverage.Console tool?
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
1 answer
Sort by: Most helpful
-
Anna Xiu-MSFT 29,926 Reputation points Microsoft Vendor
2024-06-25T08:41:44.1133333+00:00