问题描述
我有一个创建自定义性能计数器的 netcore3.1 WindowsService(使用 Microsoft.Windows.Compatibility)。在服务启动并创建计数器后,如果我使用以下 pstools 命令:psexec.exe -s -i perfmon.exe,我可以查看实例和计数。如果以任何其他方式打开 perfmon.exe,则不会显示实例。我检查了所有权限和政策。如果我将 TargetFramework 更改为 net 4.7.2,我可以查看实例和相应的计数器。不幸的是,我必须在我的应用程序中使用 netcore3.1。我附上了一张我在正常打开 perfmon.exe 时得到的图像,而不是我应该看到的图像,而不必使用 pstools 命令。另外,我附上了解决方案。任何帮助enter image description here将不胜感激。要进行测试,请使用“dotnet publish -r win-x86 -c Release”,然后使用“sc create ServiceName binPath=[path to exe in publish folder]。此外,代码在此处可用:https://github.com/vryzhikov91/test2
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)