How do you include many additional files with ClickOnce deployment?

匆匆过客 提交于 2020-01-19 13:02:08

问题


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.

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


回答1:


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.

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.

  • Select a data file in Solution Explorer.
  • In the Properties window, change the Build Action property to the Content value

2. To mark files as data files

  • With a project selected in Solution Explorer, on the Project menu, click Properties.
  • Click the Publish tab.
  • Click the Application Files button to open the Application Files dialog box.
  • In the Application Files dialog box, select the file that you wish to mark as data.
  • In the Publish Status field, select Data File from the drop-down list.

3. To mark files as prerequisites

  • With a project selected in Solution Explorer, on the Project menu, click Properties.
  • Click the Publish tab.
  • Click the Application Files button to open the Application Files dialog box.
  • In the Application Files dialog box, select the application assembly (.dll file) that you wish to mark as a prerequisite. Note that your application must have a reference to the application assembly in order for it to appear in the list.
  • In the Publish Status field, select Prerequisite from the drop-down list.

Source: MSDN - How to: Specify Which Files Are Published by ClickOnce



来源:https://stackoverflow.com/questions/34387761/how-do-you-include-many-additional-files-with-clickonce-deployment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!