您如何在 ClickOnce 部署中包含许多其他文件? [英] How do you include many additional files with ClickOnce deployment?

查看:19
本文介绍了您如何在 ClickOnce 部署中包含许多其他文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我的第一个 WPF、C# 应用程序部署到许多桌面.对于案例数据库中的大多数记录,我想将它与数据库分开存储并在按下按钮时显示(PDF 文件名等于 ID 号).它是一个仅搜索程序,用户不会将数据保存回数据库.大约有 32,000 份 pdf,而且这个数字还会增长.当我尝试在项目中列出这些文件并使用 ClickOnce 部署时,VS 说我已经超出了最大清单大小.

I am trying to deploy my first WPF, C# application to many desktops. For most records in the case database there is a large PDF which I want to store separate from the database and is displayed when a button is pressed (PDF filename equals the id number). It is a search only program, no data is being saved back to the database by users. There are approximately 32,000 pdfs and this number will grow. When I tried to list these files in the project and use ClickOnce to Deploy VS said I had exceeded the maximum manifest size.

有没有办法使用 ClickOnce 部署我的应用程序,然后使用某种类型的安装后命令复制文件?谢谢.

Is there a way to deploy my app with ClickOnce and then copy the files with some type of post-install command? Thank you.

推荐答案

将文件添加到您的项目中.将构建操作标记为 Content,将 Copy to local directory 标记为 Always.然后它会将文件包含在您的部署中.

Add the files to your project. Mark the Build Action as Content and the Copy to local directory to Always. Then it will include the files with your deployment.

您还可以检查应用程序文件"对话框以查看它们是否存在.如果文件的文件扩展名为 XML 或表示数据的内容,您希望将选项从 Include(Data) 更改为 IncludeInclude(Required).如果您包含一个文件作为数据,它会在部署后放入 DataDirectory.

You can also check the Application Files dialog to see if they are there. And if the files have a file extension of XML or something that indicates data, you want to change the option from Include(Data) to Include or Include(Required). If you include a file as data, it is put in the DataDirectory after deployment.

  • 在解决方案资源管理器中选择一个数据文件.
  • 在属性"窗口中,将构建操作"属性更改为内容"值
  • 在解决方案资源管理器中选择一个项目后,在项目"菜单上,单击属性".
  • 点击发布标签.
  • 单击应用程序文件"按钮打开应用程序文件"对话框.
  • 在应用程序文件"对话框中,选择要标记为数据的文件.
  • 在发布状态字段中,从下拉列表中选择数据文件.
  • 在解决方案资源管理器中选择一个项目后,在项目"菜单上,单击属性".
  • 点击发布标签.
  • 单击应用程序文件"按钮打开应用程序文件"对话框.
  • 在应用程序文件"对话框中,选择您希望标记为先决条件的应用程序程序集(.dll 文件).请注意,您的应用程序必须引用应用程序程序集,才能显示在列表中.
  • 在发布状态字段中,从下拉列表中选择先决条件.

来源:MSDN - 如何:指定 ClickOnce 发布哪些文件

这篇关于您如何在 ClickOnce 部署中包含许多其他文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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