NET 覆盖工具需要管理员权限吗?
我正在尝试找到一个可以在非常严格的开发环境中使用的覆盖工具,其中没有人拥有管理权限。
哪些 NET 覆盖工具需要管理员权限才能运行?
哪些覆盖工具没有此要求,或者有无需管理员权限即可运行的解决方法?
据我所知,NCover需要管理员权限才能运行,其他框架呢? (DotCover、语义设计、Partcover、Visual Studio 覆盖)
请分享您的经验,在各种工具的文档中找到有关此主题的任何内容并不容易。
I'm trying to find a coverage tool i can use in a very restrictive dev environment, where nobody has admin rights.
Which NET coverage tools require admin rights to run?
What coverage tools do not have this requirement, or have a workarounds to run without admin rights?
As far as i know, NCover needs admin rights to run, what about the other frameworks?
(DotCover, Semantic Designs, Partcover, Visual Studio coverage)
Please share your experience, it's not easy to find anything in the docs of various tools on this topic.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
分析器工具需要一些东西。
环境变量
大多数覆盖率工具都使用 .NET ProfilerAPI 在执行时检查托管代码。由于 ProfilerAPI 使用环境变量来确定是否启用分析以及使用哪个分析器,因此覆盖工具通常会在覆盖会话之前和之后写入这些环境变量。
用户可以毫无问题地写入本地环境变量,但如果该工具尝试写入系统级环境变量,您将需要管理员权限。
注册表访问
环境变量之一是非托管探查器的类标识符。如果该工具需要访问注册表来获取此标识符,您将需要管理员权限。
另一个考虑因素是,某些工具在覆盖会话之前注册非托管 COM dll,以便很好地配合 .net xcopy 部署策略。 旧版本的 NCover 用于执行此操作。
建议的解决方案是将 dll 注册为管理员。注册后,该工具不需要执行此附加步骤的权限。
There are a few things that profiler tools will require.
Environment Variables
The majority of coverage tools use the .NET ProfilerAPI to inspect managed code as it's executed. Because the ProfilerAPI uses environment variables to determine if profiling is enabled and which profiler to use, the coverage tool typically writes to these environment variables before and after the coverage session.
Users can write to local environment variables without issue, but if the tool is trying to write to system level environment variables, you'll need admin permissions.
Registry Access
One of the environment variables is the Class Identifier for the unmanaged profiler. If the tool needs to go to the registry to get this identifier, you'll need admin permissions.
The other consideration is that some tools register the unmanaged COM dll before the coverage session to play well with the .net xcopy deployment strategy. Old versions of NCover used to do this.
The proposed solution is to register the dll as an administrator. Once registered, the tool shouldn't require permissions to perform this additional step.
我们的 SD C# 测试覆盖率 工具通常需要管理员权限才能安装。它不需要管理员权限即可运行。其他 SD 测试覆盖工具和产品也是如此。
Our SD C# Test Coverage tool usually requires admin rights to install. It does not require admin rights to run. Similarly for the other SD test coverage tools and products.
PartCover 和 OpenCover 都支持每用户注册。即相当于
regsvr32 /n /i:user
Both PartCover and OpenCover support per-user registration. i.e. the equivalent of
regsvr32 /n /i:user
NCover 3 确实需要管理员权限才能安装和许可证激活,但之后,NCover 将不需要管理员权限来分析在同一会话中运行的应用程序。
当覆盖 IIS 或 Windows 服务时,NCover 将需要管理员权限,因为它们确实会启动单独的会话。
NCover 3 does require admin privileges for installation and license activation, but after that, NCover will not require admin rights to profile an application that's running in the same session.
NCover will need admin rights when covering IIS or a Windows service, since those do start a separate session.