msbuild复制文件
我在使用 MSbuild 复制文件时遇到问题,并且收到的错误消息似乎相互矛盾(使用 TFS 2008 进行构建)。
我目前的构建脚本中有以下内容
<PropertyGroup>
<ReleaseRoot>$(DropLocation)\Latest\x86\Release</ReleaseRoot>
<WebRoot>$(ReleaseRoot)\_PublishedWebsites\Web</WebRoot>
<DBRoot>$(ReleaseRoot)\Database</DBRoot>
<TempHolingDir>$(ReleaseRoot)\temp)</TempHolingDir>
<WebConfig>$(WebRoot)\Web.config</WebConfig>
<DatabaseUpdate>$(DBRoot)\databaseupdate.exe</DatabaseUpdate>
</PropertyGroup>
<Copy SourceFiles="$(WebConfig);$(DatabaseUpdate)" DestinationFolder="$(TempHoldingDir)" ContinueOnError="false" />
当我运行构建时,我得到
错误 MSB3023:无目的地 指定用于复制。请提供 “目标文件”或 “目标目录”。
然后我将 DestinationFolder 更改为 DestinationDirectory,然后我得到了
错误 MSB4064: “DestinationDirectory”参数是 “复制”任务不支持。 验证该参数是否存在 任务,并且它是一个可设置的公共 实例属性。错误 MSB4063: “复制”任务无法初始化 及其输入参数。
这些错误似乎相互矛盾,我到底错过了什么?
I am having trouble copying files with MSbuild and the error messages I'm getting seem to contradict each other (using TFS 2008 to do the build).
I currently having the following in my build script
<PropertyGroup>
<ReleaseRoot>$(DropLocation)\Latest\x86\Release</ReleaseRoot>
<WebRoot>$(ReleaseRoot)\_PublishedWebsites\Web</WebRoot>
<DBRoot>$(ReleaseRoot)\Database</DBRoot>
<TempHolingDir>$(ReleaseRoot)\temp)</TempHolingDir>
<WebConfig>$(WebRoot)\Web.config</WebConfig>
<DatabaseUpdate>$(DBRoot)\databaseupdate.exe</DatabaseUpdate>
</PropertyGroup>
<Copy SourceFiles="$(WebConfig);$(DatabaseUpdate)" DestinationFolder="$(TempHoldingDir)" ContinueOnError="false" />
When I run the build I get
error MSB3023: No destination
specified for Copy. Please supply
either "DestinationFiles" or
"DestinationDirectory".
I then change the DestinationFolder to DestinationDirectory and I got
error MSB4064: The
"DestinationDirectory" parameter is
not supported by the "Copy" task.
Verify the parameter exists on the
task, and it is a settable public
instance property. error MSB4063: The
"Copy" task could not be initialized
with its input parameters.
THese errors seem to contradict each other, what exactly am I missing here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
重新启动 Visual Studio 为我解决了这个问题,因此将其添加为遇到相同问题的其他人的潜在解决方案。
Restarting Visual Studio resolved this for me, so adding this as a potential solution for anyone else experiencing the same issue.
它是根据复制任务的DestinationFolder,看起来MSB3023错误文本是错误的?
It's DestinationFolder according to Copy Task, looks like MSB3023 error text is wrong?
这是因为当您将属性称为 TempHoldingDir 时,您将其称为 TempHolingDir。
一切都与 d 有关。
Its because you called your property TempHolingDir when your referred to it as TempHoldingDir.
Its all about the d.