开发者

Problem with installing windows service using CC.NET and MSBUILD

I am trying to install a windows service using MSBuild and CCNET. I am using MSBuild Extension pack WindowsService task to install and start the windows service as part of automated build. The script section look like this

<!--install service-->
<MSBuild.ExtensionPack.Computer.WindowsService TaskAction="Install" ServiceName="$(PrServiceName)" ServicePath="$(PrServicePath)" User="$(User)" />

<!--set service to run automatically on restart-->
<MSBuild.ExtensionPack.Computer.WindowsService TaskAction="SetAutomatic" ServiceName="$(PrServiceName)" />

<!--start service-->
<MSBuild.ExtensionPack.Computer.WindowsService TaskAction="Start" ServiceName="$(PrServiceName)" ServicePath="$(PrServicePath)" User="$(User)" />

Now as soon as the the first task runs to install the service, it fails with the following error

E:\Data\cc_temp\Projects\cubic\intranet\pr\pr.build (137,3): error : Install Service failed with code: 'AccessDenied'

I assume this is because the script is running under cruise control service user account which does not have the appropriate permissions for installing a windows service.

I would just like to give minimal permissions to the cruise cont开发者_开发问答rol user account instead of giving the full administrative rights.

Does anyone out there knows how can i achieve this?

Awaiting Nabeel


Nabeel you are on the right track, it has to be a permissions issue. We do this all the time in our build using the same tools and it works. Have you checked to see which account the service is running as? and using the same user account to run your cruisecontrol? at least then you would possibly prove/disprove the permissions issue.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜