EnableCodeCoverage -is throwing Microsoft.VisualStudio.CodeCoverage.Shim dll dependency error while test execution

using - $PATH_tool\VsTest\16.0.1\x64\tools\net451\Common7\IDE\Extensions\TestPlatform>vstest.console.exe DLL_NAMES /InIsolation /Logger:“trx” /TestAdapterPath:"$ADAPTERPATH" /Enablecodecoverage:true

Error logs:
Starting test execution, please wait…
An exception occurred while invoking executor ‘executor://nunit3testexecutor/’: Exception has been thrown by the target of an invocation.
Could not load file or assembly ‘Microsoft.VisualStudio.CodeCoverage.Shim, Version=15.0.0.0, Culture=neutral, PublicKeyToken=#####’ or one of its dependencies. The system cannot find the file specified.

Hi @Sneha_Agarwal. On the face of it, this looks like a problem with the MS code coverage tool.

Does the error still occur if you remove all Sonar-related steps from your build?