如何使用基于 WiX 的安装程序为 .NET 应用程序创建性能计数器?

发布于 2024-09-26 04:27:52 字数 283 浏览 0 评论 0原文

我正在为我的基于 .NET 的网站创建一个基于 WiX 的安装程序。

该网站的一部分涉及我想使用安装程序创建的性能计数器(计数器需要提升的权限才能创建,这是网站不应该拥有的)。

我已阅读 WiX 提供的关于安装计数器的文档,但是它看起来是针对本机代码应用程序,而且似乎付出的努力比其价值要多。

如何使用 WiX 安装程序创建新的性能计数器?

I'm creating a WiX-based installer for my .NET-based website.

Part of this website involves the performance counters which I would like to create using the installer (counters require elevated permissions to create, something the website should never have).

I have read the documentation provided by WiX on the subject of installing counters, however it looks aimed at native-code applications and seems like it's more effort than it's worth.

How can I create new performance counters using a WiX installer?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

书间行客 2024-10-03 04:27:52

您引用的文章涉及 WiX v2。然而,您实际使用的是哪个版本的 WiX 工具集并不明显。

WiX v3 具有易于使用的元素 PerformanceCategory性能计数器。我们在 .NET Web 应用程序安装程序中使用它来安装我们需要的性能计数器。

希望这有帮助。

The article you reference refers to WiX v2. It is not obvious however which version of WiX toolset you actually use.

WiX v3 has easy-to-use elements PerformanceCategory and PerformanceCounter. We use it in our .NET web application installer to install performance counters we need.

Hope this helps.

怎樣才叫好 2024-10-03 04:27:52

我从未在 .net 中做过性能计数器,所以我必须了解物理部署要求是什么。从那里我可以帮助您将其转化为 WiX,并着眼于最佳实践。

如何:使用自定义性能计数器

.NET 似乎有一个regsvr 类型模式由 System.Diagnostics 中的某些类实现。您可以使用 WiX 的 DTF 调整此代码来创建自定义操作来创建性能计数器,但这感觉不太正确。该网页上还有一些信息,表明计数器在 CurrentControlSet\Services 下注册,因此可以仅使用注册表或 ServiceInstall 表来完成工作,而无需编写自定义操作。

I've never done performance counters in .net so I'd have to understand what the physical deployment requirements are. From there I could help you translate that into WiX with an eye for best practices in mind.

How To: Use Custom Performance Counters

It seems .NET has a regsvr type pattern implemented by some classes in System.Diagnostics. You could adapt this code with WiX's DTF to create a custom action to create the performance counters but this doesn't feel quite right. Also on that web page is some information that says the counters get registered under CurrentControlSet\Services so it might be possible to just use the Registry tables or ServiceInstall table to do the work without writing a custom action.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文