TFS 2010 Build - 批处理文件“访问被拒绝”
运行 TFS 2010
我试图进行概念验证,将批处理文件作为构建过程的一部分运行。我的构建序列中有一个“invokeProcess”,它运行一个批处理文件。当我运行构建时,它“部分成功”,然后在批处理文件上显示“访问被拒绝”错误。
想法?老实说,我什至不确定如何诊断它试图在哪个用户下运行。
Running TFS 2010
I am trying to do a proof of concept, having batch files run as part of the build process. I have an 'invokeProcess' in my build seqeunce which runs a batch file. When I run the build, it 'partially succeeds' and then shows an 'access denied' error on the batch file.
Thoughts? Honestly I'm not even sure how to diagnose what user it is trying to run under.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的构建服务器与 TFS 服务器不同吗?在我们的环境中,我们的构建服务器运行所有执行构建的 Windows 服务。这些构建是在构建服务配置为启动的用户 ID 的上下文中执行的。
要执行批处理文件,您不仅需要授予批处理文件本身的权限,还需要授予 cmd.exe 文件的权限(因为这将执行新的命令行进程)以及批处理的任何可执行文件文件可能会调用。
尝试运行 procmon (http://technet.microsoft.com/en-us/sysinternals/bb896645) 并再次执行构建 - 它将准确显示系统拒绝访问哪些文件。
Is your build server different than your TFS server? In our environment, our build server runs all the windows services that execute the builds. Those builds are executed under the context of the user id that the build service is configured to start with.
To execute a batch file, you not only need to give permissions to the batch file itself, but you also need to grant rights to the cmd.exe file (since this will execute a new command line process) as well as any executables your batch file may call.
Try running procmon (http://technet.microsoft.com/en-us/sysinternals/bb896645) and execute your build again - it will show you exactly what files the system is denying access to.
您是否已验证作为构建服务身份的服务帐户有权访问批处理位置?您可以在 TFS 管理控制台(在 TFS 服务器上可用)中找到服务帐户
Have you verified that the service account that is the identity for the build service has access to the batch location? You can find the service account in the TFS Administration Console (available on your TFS Server)