有谁知道如何让我在 ServiceInstall 中声明的参数在服务启动时传递给服务?它们在我的 OnStart(string[] args) 中似乎总是为空。
<ServiceInstall
Id="ServiceInstaller"
Type="ownProcess"
Vital="yes"
Name="MyService"
DisplayName="MyService"
Description="MyService Desc"
Start="auto"
Account="LocalSystem"
ErrorControl="ignore"
Interactive="yes"
Arguments="MY ARGS HERE"
>
</ServiceInstall>
<ServiceControl Id="ServiceControl" Start="install" Stop="both" Remove="uninstall" Name="MyService" Wait="yes" />