为什么不的ClickOnce在Visual Studio中,从依赖程序集部署内容的文件?集部、文件、程序、内容

2023-09-02 11:52:31 作者:大花裤衩衩

我有一个通过点击一次部署智能客户端应用程序。现在的问题是,我在依赖程序集的内容的文件,只是没有在发布的应用程序文件在Visual Studio对话框显示出来。

I have a smart client application that is deployed via click once. The problem is that i have content files in dependent assemblies that just don't show up in the published application files dialog in visual studio.

这意味着,每次我部署我要所有的内容文件从应用程序生成的输出目录复制到已发布的目录,并重建它是一个真正的痛苦的体现。

This means that everytime I deploy I have to copy all the content files from the application build output directory into the published directory and rebuild the manifests which is a real pain.

为什么这些文件不可见的Visual Studio中的发行?

Why are these files not visible to the publisher in visual studio?

推荐答案

好吧,我仍然不知道为什么Visual Studio中不能显示所引用内容的文件,其发布的用户界面,但我发现了一个变通强制发布到包含这些文件

Ok I still don't know why Visual studio cannot display referenced content files with its publish ui but I found a work around to force the publish to include these files.

在项目文件将这个。

<ItemGroup>
<AdditionalPublishFile Include="$(OutputPath)***.rpt">
  <Visible>False</Visible>
</AdditionalPublishFile>
</ItemGroup>
<Target Name="BeforePublish">
  <Touch Files="@(IntermediateAssembly)" />
  <CreateItem Include="@(AdditionalPublishFile)" AdditionalMetadata="TargetPath=%(RecursiveDir)%(Filename)%(extension);IsDataFile=false">
    <Output TaskParameter="Include" ItemName="_DeploymentManifestFiles" />
  </CreateItem>
</Target>

请注意,在某些情况下,重新启动Visual Studio中(不只是重装项目)可能需要这些更改生效。

Note that in some circumstances restarting Visual Studio (not just reloading the project) may be required for these changes to take effect.

 
精彩推荐
图片推荐