Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Improve error message when execute permissions are missing #665

Open
4 of 5 tasks
sharwell opened this issue Mar 11, 2017 · 1 comment
Open
4 of 5 tasks

Improve error message when execute permissions are missing #665

sharwell opened this issue Mar 11, 2017 · 1 comment

Comments

@sharwell
Copy link

Please provide the following information when submitting an issue, where appropriate replace the [ ] with a [X]

My Framework

  • .NET 4.5

My Environment

  • Windows 7 or below (not truly supported due to EOL)

My issue is related to (check only those which apply):

  • no coverage being recorded
  • 32 or 64 bit support
  • feature request

Expected Behavior

It would be helpful if one of the following was used to alert the user to the problem:

  • Detect that OpenCover.Profiler.dll does not have execute permissions for the current user, and report a specific error message in this case.
  • In the event that register fails with error code 3 (I believe this is the :3 in the current message) and the profiler DLL exists, update the error message to alert the user that the file may not have execute permissions for the current user.

Actual Behavior

A message like the following is reported:

Failed to register(user:True,register:True,is64:False):3 the profiler assembly; you may want to look into permissions or using the -register:user option instead. C:\windows\system32\regsvr32.exe /s  /n /i:user "D:\packages\OpenCover.4.6.519\tools\x86\OpenCover.Profiler.dll"

If the indicated regsvr32.exe command is run from the command line, it exits with code 3.

Steps to reproduce the problem:

Remove execute permissions for the current user from OpenCover.Profiler.dll. Then run OpenCover.Console.exe with the -register:user argument.

This situation is similar to the way our Jenkins server is configured. Our NuGet packages are included in Git (sigh), and if the file does not have the execute bit set in Git then the ACLs are automatically set when the file is checked out to not allow the build user on Windows to execute the file. After many trial-and-error attempts, fixing this error required us to use the following:

git update-index --chmod +x packages/OpenCover.4.6.519/tools/x86/OpenCover.Profiler.dll
@SteveGilham
Copy link
Contributor

Related : when gathering coverage data for services, the service account needs to have read/execute rights to the profiler DLL as well. The symptom in that case is that no coverage is recorded -- no assemblies at all in the files.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants