MSBuild 包任务 - Web 部署
我正在尝试将自定义文件添加到我们的 Web 部署包中,根据此博客文章:http: //sedodream.com/2010/05/01/WebDeploymentToolMSDeployBuildPackageInclusionExtraFilesOrExducingSpecificFiles.aspx
<Target Name="CustomCollectFiles">
<Message Text="AppBuildFolder = $(AppBuildFolder)"/>
<ItemGroup>
<_CustomFiles Include="..\*Repository*\**\*.dll;..\*Repository*\**\*.pdb" Condition="'$(AppBuildFolder)' == ''" />
<_CustomFiles Include="$(AppBuildFolder + '*.dll');$(AppBuildFolder + '*.pdb')" Condition="'$(AppBuildFolder)' != ''" />
<FilesForPackagingFromProject Include="%(_CustomFiles.Identity)">
<DestinationRelativePath>bin\%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
</ItemGroup>
<Message Text="Files found: @(_CustomFiles)"/>
</Target>
我们在 AppBuildFolder 中还有一些其他引用,需要将其复制到包中,但我从未在消息中看到任何输出的文件。有什么想法吗?
谢谢 安迪
I'm trying to add custom files to our web deployment package, per this blog posting: http://sedodream.com/2010/05/01/WebDeploymentToolMSDeployBuildPackageIncludingExtraFilesOrExcludingSpecificFiles.aspx
<Target Name="CustomCollectFiles">
<Message Text="AppBuildFolder = $(AppBuildFolder)"/>
<ItemGroup>
<_CustomFiles Include="..\*Repository*\**\*.dll;..\*Repository*\**\*.pdb" Condition="'$(AppBuildFolder)' == ''" />
<_CustomFiles Include="$(AppBuildFolder + '*.dll');$(AppBuildFolder + '*.pdb')" Condition="'$(AppBuildFolder)' != ''" />
<FilesForPackagingFromProject Include="%(_CustomFiles.Identity)">
<DestinationRelativePath>bin\%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
</ItemGroup>
<Message Text="Files found: @(_CustomFiles)"/>
</Target>
We have some other references located at AppBuildFolder that we need copied into the package, but I never see any File found outputted in the message. Any ideas?
Thanks
Andy
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,问题是这样的。我们正在使用 Nant 的 MsBuild 任务来构建 Web Deploy 项目。
显然,当像这样调用任务时:
MsBuild 最终得到这个值
c:\myfolder"
。请注意末尾的双引号,而不是c:\myfolder\
因此解决方法是更改
并使用
元素传递值。,问题出在 MsBuild 任务上。 NantContrib。
希望这可以节省其他人的时间。
Ok, so the problem was this. We are using Nant's MsBuild task to build the Web Deploy project.
Apparently, when calling the task like this:
MsBuild ends up with this value
c:\myfolder"
. Notice the double quote at the end, instead ofc:\myfolder\
.The fix was to change the
<property />
and pass the value using the<arg />
element.So, the problem was the MsBuild task in NantContrib.
Hope this saves somebody else some time.
您缺少将该目标注入到构建中的 PropertyGroup。您也应该包括这一点,我怀疑该目标没有执行,因此它们永远不会被添加。另外,您可能想关注我的博客,因为有一个更简单的方法可以做到这一点,当我有时间时我会很快写博客。
You are missing the PropertyGroup that injects that target into the build. You should include that as well, I suspect that this target is not executing so they never get added. Also you might want to keep an eye on my blog because there is a simpler way to do this, I will blog it soon when I have time.