开发者

MSBuild Package task - Web Deploy

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


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>
  <property name="AppBuildFolder" value="${Some.Path.Ending.In.Backslash}" />
</msbuild>

MsBuild ends up with this value c:\myfolder". Notice the double quote at the end, instead of c:\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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜