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

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

问题描述

我正在尝试将我的第一个WPF C#应用程序部署到许多台式机上.对于案例数据库中的大多数记录,有一个很大的PDF,我想与数据库分开存储,并在按下按钮时显示(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天全站免登陆