msbuild/clickonce发布在生成过程中生成的文件 [英] msbuild/clickonce publish files generated during the build

查看:106
本文介绍了msbuild/clickonce发布在生成过程中生成的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为构建过程的一部分,我生成了一些在创建clickonce部署时应包括的文件.

As a part of my build process I generate some files that should be included when creating a clickonce deployment.

此处是一篇博客文章,某人告诉您如何包括不属于该项目的项目.但是,正如某人在该博客文章的评论中提到的那样,当您在"BeforePublish"任务中执行该操作时,它不会更新Deploymentmanifest,并且文件也不会下载-如果您在"BeforeBuild"中进行操作,则可以正常工作任务虽然.

Here is a blog post of someone telling you how to include items that's not part of the project. However, as someone mentions in the comments of that blogpost, it won't update the deploymentmanifest when you do it in the "BeforePublish" task and the files won't get downloaded - it works fine if you do it in the "BeforeBuild" task though.

这给了我一个鸡与蛋的问题,因为我必须先执行构建才能生成要包含的文件.

This gives me a chicken and egg problem as I have to perform the build first to generate the files I want included..

有人对此有解决方案吗?

Does anyone have a solution for this ?

(目前无法使用mage.exe生成clickonce部署,必须使用发布"目标来完成)

(p.s. at the moment generating the clickonce deployment using mage.exe is not an option, it have to be done using the Publish target)

推荐答案

您可以执行以下操作:

<ItemGroup Condition="'$(Configuration)' == 'Release'">
    <Content Include="..\bin\Release\Reports\Report.srf" Condition="Exists('..\bin\Release\Reports\Reports.srf')">
      <Link>Reports\Reports.srf</Link>
      <Visible>false</Visible>
    </Content>
</ItemGroup>

这将要求您运行构建并以2个步骤发布.也就是说,从干净 工作副本,msbuild /p:Configuration=Release /t:Publish不会在部署中包括此文件,您必须首先运行msbuild /p:Configuration=Release,然后运行msbuild /p:Configuration=Release /t:Publish,清单将在发布期间得到更新.

This will require that you run the build and publish in 2 steps. That is, from a clean working copy, msbuild /p:Configuration=Release /t:Publish will not include this file in the deployment, you'll have to first run msbuild /p:Configuration=Release and then msbuild /p:Configuration=Release /t:Publish , the manifest will get updated during the Publish.

这篇关于msbuild/clickonce发布在生成过程中生成的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆