如何使用 MSBuild 部署到 TeamCity 中的文件夹?

发布于 2024-11-03 07:43:28 字数 683 浏览 9 评论 0原文

在我的本地开发计算机上,这工作得很好:

msbuild project.name.csproj /p:DeployOnBuild=true /p:DeployTarget=PipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="c:\proyectos\folder1\deploy" /p:AutoParameterizationWebConfigConnectionStrings=false

我正在尝试使用 MSBuild 在 TeamCity 中配置构建步骤,在“命令行参数”中,我将其放入:

/p:DeployOnBuild=true /p:DeployTarget=PipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="c:\proyectos\folder1\deploy" /p:AutoParameterizationWebConfigConnectionStrings=false

它运行,不显示错误,但文件不会复制到"c:\proyectos\folder1\deploy"

编辑:我在命令提示符上使用 MSBuild 时遇到了同样的问题,所以它不是 teamcity。我的本地开发机器是 Windows 7,服务器是 Windows 2003

On my local dev machine this works perfectly:

msbuild project.name.csproj /p:DeployOnBuild=true /p:DeployTarget=PipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="c:\proyectos\folder1\deploy" /p:AutoParameterizationWebConfigConnectionStrings=false

I'm trying to configure a Build step in TeamCity with MSBuild, in the "Command line parameters" I'm putting this:

/p:DeployOnBuild=true /p:DeployTarget=PipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="c:\proyectos\folder1\deploy" /p:AutoParameterizationWebConfigConnectionStrings=false

It runs, no errors are displayed, but files are not copied to "c:\proyectos\folder1\deploy"

Edit: I'm having the same issues with MSBuild on the command prompt, so it's not teamcity. My local dev machine is on windows 7 and the server is windows 2003

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

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

发布评论

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

评论(4

想念有你 2024-11-10 07:43:28

使用 /v:dv:diag 运行以获取日志记录。

(首先让它在本地工作,但是......在 TeamCity 中,在控制台中查看代理并查看代理详细日志以获取类似的此类日志(或者只是通过相同的 /v: 标志传递给 MSBuild)团队城市))

Run with /v:d or v:diag to get logging.

(Get it working local first but... In TeamCity, view the agent in the console and look at the agent detail logs for similar such logs (or just pass the same /v: flag to MSBuild via TeamCity))

三生一梦 2024-11-10 07:43:28

您需要确保运行“TeamCity Build Agent Service”的用户具有相关目录的写入权限。

(FWIW,我相信 LocalSystem 帐户在 Server 2003 和 Windows 7 中具有不同的组成员身份。我们在自己的“teamcity”帐户下运行所有​​ TeamCity 构建代理,以更明确地控制权限并允许访问网络共享。)

You'll want to ensure that the user running the "TeamCity Build Agent Service" has write access to the relevant directories.

(FWIW, I believe the LocalSystem account has different group memberships in Server 2003 and Windows 7. We run all of our TeamCity build agents under their own "teamcity" accounts to more explicitly control permissions and allow access to network shares.)

苏别ゝ 2024-11-10 07:43:28

安装 Visual Studio 2010 确实可以解决此问题。但是,您也可以通过将适当的构建目标复制到您的计算机来修复它。通常,在您的开发计算机上,它们将位于(或者去掉 32 位计算机的 (x86))

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web

在那里您会发现一堆 Microsoft.Web.Publishing.* 目标。

只需将它们复制到构建计算机上的相应位置即可,一切都会好起来的。

Installing Visual Studio 2010 DOES fix this problem. But, you can also fix it by copying the appropriate build targets to your machine. Typically, on your dev machine they'll be at (Or take away the (x86) for 32 bit machines):

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web

In there you'll find a bunch of Microsoft.Web.Publishing.* targets.

Just copy those over to the equivalent location on your build machine and all will be well.

我三岁 2024-11-10 07:43:28

通过服务器中的Web平台安装Web部署工具对我来说很有效。实际上 Visual Studio 安装会安装 Web 部署,这可能是它适用于 @himinaya 的原因。

Installing Web deploy tool through web platform in the server works for me. Actually visual studio installation installs web deploy, It might be the reason why it works for @himinaya.

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