访问Windows服务 [英] Accessing Windows services

查看:79
本文介绍了访问Windows服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个C ++ UWP应用程序,它使用自定义功能通过RPC与Windows NT服务对话。 UWP应用程序使用桌面扩展程序启动Win32(C#)应用程序。 Win32应用程序安装Windows NT服务。我们正在使用一个包装项目,该项目引用了
UWP应用程序,Win32应用程序和Windows NT服务项目。我们能够打包UWP应用程序,Win32应用程序和Windows服务并安装软件包。包装
项目的包示例文件中提到了自定义功能,桌面扩展和App Elevation支持等。当程序包启动时,它可以启动UWP应用程序,并使用win32应用程序成功安装该服务。但是当UWP应用程序尝试与服务通信时,RPC通信失败。它显示错误"RPC
服务器不可用"。这可能是什么原因? UWP应用程序能够在没有打包项目的情况下与Windows服务进行通信。为什么包装项目中的UWP应用程序无法访问该服务?包装
项目是否需要自己的自定义功能和SCCD文件等?如果是,我们如何将这些纳入包装项目并访问服务

解决方案

您好,


我不确定这一点。我怀疑这可能与本地网络环回有关。您可以使用以下命令启用循环:

 c:\> checknetisolation loopbackexempt -a -n =< package family name> 

并使用以下命令禁用它:

 c:\> checknetisolation loopbackexempt -d -n =< package family name> ; 

有关详细信息,请参阅此文档:在侧载Windows应用商店应用中使用网络环回。请注意,它仅适用于侧载应用。



祝你好运,


Roy


I have a C++ UWP app that talks to a Windows NT service via RPC using Custom Capability. The UWP app launches a Win32(C#) app using desktop extension . The Win32 app installs the Windows NT service .We are using a packaging project which references the UWP app, the Win32 app and the Windows NT service projects. We are able to package the UWP app, the Win32 app and the Windows ervice and install the package. The custom capability ,desktop extension and App Elevation support etc are mentioned in the packaging project's package manifet file. When the package launches , it is able to launch the UWP app and the service is installed successfully using the win32 app. But when the UWP app tries to talk to the service the RPC communication fails. It shows error "RPC Server is unavailable". What could be the reason here? The UWP app is able to communicate to the Windows service without the packaging project otherwise. Why is the service not accessible to the UWP app from within the packaging project? Does the packaging project need its own custom capability and SCCD file etc? If yes, how can we incorporate these into the packaging project and access the service

解决方案

Hi,

I'm not sure about this. I suspect this might be related to the local network loopback. You could enable the loop back using this command:

c:\>checknetisolation loopbackexempt -a -n=<package family name>

And disable it with this command:

c:\>checknetisolation loopbackexempt -d -n=<package family name>

For more details, please refer this document:Using network loopback in side-loaded Windows Store apps. Please note, it only works for side-loaded apps.

Best regards,

Roy


这篇关于访问Windows服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆