Click-once publish addtional files stopped with VS 2012

流过昼夜 提交于 2019-12-05 08:47:09

I found your question baffling because I've never seen anybody do this with ClickOnce before, so I talked to the ClickOnce guy at Microsoft about it. He said that what you are doing it not supported, so it's not something they would have tested for. There are multiple changes to msbuild that could have broken what you are doing.

Is what you are trying to do is get files associated with a secondary reference included in the deployment? In other words, you have a main project that references another assembly that is created by building a second project, and the second assembly has content files, and you want them included in your project?

If that's what you are trying to do, you should consider linking those files to the main project instead. To do that, you can add an existing item as a link, and point it to the content in the second project. Then the content will be included when you build the first project.

Move the CreateItem task to the BeforeBuild step and remove the Touch task:

<ItemGroup>
  <AdditionalPublishFile Include="$(OutputPath)\**\*.rpt">
    <Visible>False</Visible>
  </AdditionalPublishFile>
</ItemGroup>
<Target Name="BeforeBuild">
  <CreateItem Include="@(AdditionalPublishFile)" AdditionalMetadata="TargetPath=%(RecursiveDir)%(Filename)%(extension);IsDataFile=false">
    <Output TaskParameter="Include" ItemName="_DeploymentManifestFiles" />
  </CreateItem>
</Target>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!