This problem occurs when a project has build without problems under a user account, but the compilation fails when it is run under Jenkins CI. It manifests in compiler errors like this one:
Here MSBuild has called the compiler directly, instead of calling the wrapper, and the compiler did not understand the CoverageScanner options.
To correct this, it is necessary to set the environment variable
LOCALAPPDATA at the beginning of the Jenkins build script. Its value
must be the path to the
AppData directory of another user, i.e.
C:\Users\SomeUser\AppData\Local. The build script will
then look like this: