问题
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