使用VSTS时如何在Azure云服务包中包含其他文件? [英] How can I include additional files in an Azure cloud services package when using VSTS?

查看:51
本文介绍了使用VSTS时如何在Azure云服务包中包含其他文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个解决方案,其中包含一个Web项目和一个云项目,用于将该Web项目作为 cspkg 文件部署到云服务.这一切都很好.但是,我有一个我不需要在网络项目中想要的文件,但是我愿意要与 cspkg 文件一起部署到云服务中

I have a solution with a web project in it and a cloud project for deploying that web project as a cspkg file to a cloud service. This all works fine. However, I have a file that i don't want in the web project but I do want deployed with the cspkg file into the cloud service.

我们使用VSTS来构建和部署事物,但我还没有弄清楚如何在此系统的程序包中包括额外的文件.我尝试了复制文件"步骤,但没有将文件放入包中,尽管确实将其放入工件中.我尝试了其他在网上找到的东西,例如PipelineCollectFilesPhaseDependsOn注入技术,但似乎无济于事.

We use VSTS to build and deploy things, and I haven't figured out how to include extra files in the package within this system. I tried a Copy Files step but that doesn't get the file into the package, it does get it into the artifacts though. I tried other things I found online, like the PipelineCollectFilesPhaseDependsOn injection technique, but nothing seems to work.

这有可能吗?如果可以的话,怎么办呢?

Is this possible, and if so, how can it be done?

推荐答案

Azure部署程序包文件(CSPKG)文件已压缩并加密,没有更好的方法来添加其他文件(更多详细信息:

The Azure deployment package file (CSPKG) file is zipped and encrypted, there isn’t the better way to add additional files (More details: Include/Exclude files when creating Azure package). But you can include the files in BeforeBuild target. For this way, you don’t need to include files to the web project.

例如:

  1. 编辑Web项目文件(例如WebRole1.csproj)
  2. 在标记之前添加BeforeBuild目标.

代码:

<Target Name="BeforeBuild">
    <ItemGroup>
      <Content Include="Files\TT.txt">
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      </Content>
    </ItemGroup>
  </Target>

这篇关于使用VSTS时如何在Azure云服务包中包含其他文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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