通过 Web 部署项目创建虚拟目录时访问被拒绝

发布于 2024-07-05 21:15:10 字数 730 浏览 11 评论 0原文

我正在尝试在 TFS 解决方案中使用 (VS 2008) Web 部署项目将网站部署到 (TFS 2008) 构建服务器以运行基于 Web 的单元测试。 由于某种原因,我还无法弄清楚,它无法创建虚拟目录:

使用程序集“C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment 中的“CreateVirtualDirectory”任务。任务.dll”。 任务“创建虚拟目录” 正在初始化 IIS Web 服务器... C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(667,5):错误:访问被拒绝。 C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(667,5):错误: 无法创建虚拟目录“abc”。 完成执行任务“CreateVirtualDirectory”——失败。

TFSService 用户当然位于 TFS Build 计算机(运行 Windows Server 2008)上的管理员组中。 我不知道还有什么问题。 我检查了事件日志,没有任何线索。 我可以通过 IIS 控制台在该计算机上手动创建虚拟目录,没有任何问题。

有什么想法可能是什么问题或如何进一步诊断的建议吗?

I’m trying to use a (VS 2008) Web Deployment project in a TFS solution to deploy the web site to the (TFS 2008) build server to run web based unit tests.
For some reason, that I can't yet figure out, it is failing to create the virtual directory:

Using "CreateVirtualDirectory" task from assembly "C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.Tasks.dll".
Task "CreateVirtualDirectory"
Initializing IIS Web Server...
C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(667,5): error : Access is denied.
C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(667,5): error :
Failed to create virtual directory 'abc'.
Done executing task "CreateVirtualDirectory" -- FAILED.

The TFSService user certainly is in the Administrators group on the TFS Build machine (which is running Windows Server 2008). I don’t know what else could be wrong. I’ve checked the event log an there’s no clues there. I am able to manually create the virtual directory on that machine through the IIS console with no problem.

Any ideas what could be the problem or suggestions for how to diagnose this further?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

别闹i 2024-07-12 21:15:10

它必须是权限...您是否尝试将 TFSService 放入您所在的同一组中?

it has got to be permissions...did you try putting the TFSService in the same Groups you are in?

御弟哥哥 2024-07-12 21:15:10

TFS 帐户是否在与用于连接 IIS 的帐户相同的权限下运行? 按照克雷格的建议进行操作,并将 TFS 帐户移至您参与的组中。

Is the TFS account running under the same privileges as the account that you use to connect to IIS? Do as Craig suggested and move the TFS account into the groups that you participate in.

雾里花 2024-07-12 21:15:10

您确定构建正在 TFSService id 下运行,而不是在专门为构建设置的另一个 id 下运行,并且该 id 可能不在管理员组中? 因为我主要进行单独开发,所以我除了玩自动化构建之外没有做更多的事情,但我记得当我查看此内容时设置了一个单独的构建 id。

You're sure that the build is running under the TFSService id and not under another id set up just for builds, and which may not be in the administrator's group? I haven't done more than just play with automated builds since I do mostly solo development, but I recall setting up a separate build id when I was looking at this.

柠檬色的秋千 2024-07-12 21:15:10

我见过当 IIS 服务器未在默认端口上运行时会发生这种情况。 我建议检查 IIS 以查看它是否在端口 80 上运行,作为进一步诊断问题的步骤。

I have seen this occur when the IIS server wasn't running on the default port. I'd recommend checking IIS to see if it's running on port 80 as a step to diagnose your issue further.

一笔一画续写前缘 2024-07-12 21:15:10

我最终通过从 TFS 构建脚本调用 Web 应用程序的 _CopyWebApplication 构建目标(手动创建 IIS 虚拟目录之后)成功地进行了部署。
我必须添加一个额外的目标,以获取要复制的项目中的链接文件,因为内置的 _CopyWebApplication 目标不包含这些文件。

I eventually managed to get deployment working by calling the _CopyWebApplication build target of the web application from my TFS build script (after manually creating the IIS virtual directory).
I had to add an additional target though to get linked files in the project to be copied also as the built in _CopyWebApplication target doesn't include those.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文