简体   繁体   English

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

[英]How do I create performance counters for a .NET application with a WiX-based installer?

I'm creating a WiX-based installer for my .NET-based website. 我正在为基于.NET的网站创建一个基于WiX的安装程序。

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. 我已经阅读 WiX提供的关于安装计数器的文档 ,但是它看起来针对本机代码应用程序,看起来它比它的价值更多的努力。

How can I create new performance counters using a WiX installer? 如何使用WiX安装程序创建新的性能计数器?

The article you reference refers to WiX v2. 您引用的文章是指WiX v2。 It is not obvious however which version of WiX toolset you actually use. 然而,您实际使用的是哪个版本的WiX工具集并不明显。

WiX v3 has easy-to-use elements PerformanceCategory and PerformanceCounter . WiX v3具有易于使用的元素PerformanceCategoryPerformanceCounter We use it in our .NET web application installer to install performance counters we need. 我们在.NET Web应用程序安装程序中使用它来安装我们需要的性能计数器。

Hope this helps. 希望这可以帮助。

I've never done performance counters in .net so I'd have to understand what the physical deployment requirements are. 我从未在.net中完成性能计数器,因此我必须了解物理部署要求是什么。 From there I could help you translate that into WiX with an eye for best practices in mind. 从那里,我可以帮助您将其转化为WiX,并着眼于最佳实践。

How To: Use Custom Performance Counters 如何:使用自定义性能计数器

It seems .NET has a regsvr type pattern implemented by some classes in System.Diagnostics. 似乎.NET有一个由System.Diagnostics中的某些类实现的regsvr类型模式。 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. 您可以使用WiX的DTF调整此代码,以创建自定义操作来创建性能计数器,但这感觉不太对。 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. 此网页上还有一些信息表明计数器已在CurrentControlSet \\ Services下注册,因此可以使用Registry表或ServiceInstall表来完成工作,而无需编写自定义操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在不以管理员身份运行的情况下读取.NET应用程序中的性能计数器? - How do I read performance counters in a .NET application without running as an administrator? 如何为 .NET 项目创建自定义 Wix 安装程序? - How to create a custom Wix Installer for a .NET project? 如何使用完全独立的.NET 3.5 sp1安装程序制作WiX安装程序? - How do I make a WiX installer with a completely self-contained .NET 3.5 sp1 installer? 如何使用Wix Toolset为ASP.NET Core应用程序创建MSI安装程序 - How to create MSI installer for ASP.NET Core application using Wix Toolset 如何为.NET winforms应用程序创建安装程序,使其不需要安装? - How do I create an installer for a .NET winforms application so it doesn't need to install? 如何在Application Insights中禁用标准性能计数器? - How to disable standard performance counters in Application Insights? 为什么我需要管理员来阅读.NET CLR内存性能计数器 - Why do I need to be admin to read .NET CLR Memory performance counters 如何提高ASP.NET MVC应用程序性能? - How do I improve ASP.NET MVC application performance? 如何测试.NET应用程序的性能并对其进行优化? - How do I test performance of my .NET application and optimize it? 如何为.NET Windows应用程序编写安装程序(需要安装Access驱动程序) - How do I write an installer for a .NET Windows application (need to install Access drivers)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM