Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
593 views
in Technique[技术] by (71.8m points)

c# - How do you include many additional files with ClickOnce deployment?

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...