我使用 Visual Studio 创建了一个 Windows 服务项目,需要使用 MSBuild 安装到远程机器上。我查看了很多有关部署 Windows 服务的好方法的资源。大多数答案都使用 PowerShell 脚本,我认为这是替代方案。
谁能给我提供好的资源。关于如何部署它的任何想法。在企业环境中部署 (.exe) 文件存在很多安全问题,所以我担心选择任何替代方案。
我将非常感谢任何建议。
最佳答案
您可以使用 MSBuild 安装示例:
<MSBuild.ExtensionPack.Computer.WindowsService TaskAction="Install" ServiceName="SomeWindowsService" User="UserLocal" Password="PassLocal" ServicePath="\\RemoteComp2\PathForYourService\WindowsService.exe" RemoteUser="UserRemoteComp2" RemoteUserPassword="PassRemoteComp2" MachineName="RemoteComp2"/>
有关更多信息,请查看以下链接 http://www.msbuildextensionpack.com/help/4.0.5.0/html/258a18b7-2cf7-330b-e6fe-8bc45db381b9.htm
关于c# - 如何使用 MSBuild 部署 Windows 服务?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15752200/