开发者

ClickOnce Application Files Download Group

开发者 https://www.devze.com 2023-01-26 00:35 出处:网络
I have an application that I\'m wanting to use ClickOnce to deploy. Here are some of the files that I\'ll need:

I have an application that I'm wanting to use ClickOnce to deploy. Here are some of the files that I'll need:

  1. MyProgram.exe (medium size)
  2. MyProgram.exe.config (small size)
  3. MyMenu.xml (small size)
  4. Shared.dll (medium size)
  5. ThirdParty1.dll (X-large size)
  6. ThirdParty2.dll (X-large size)
  7. ThirdParty3.dll (X-large size)
  8. OtherThirdParty1.dll (X-large size)
  9. OtherThirdParty2.dll (X-large size)
  10. OtherThirdParty3.dll (X-large size)

I attempted to set groups in the Application Files section like this:

ThirdParty

  1. ThirdParty1.dll
  2. ThirdParty2.dll
  3. ThirdParty3.dll

OtherThirdParty

  1. OtherThirdParty1.dll
  2. OtherThirdParty2.dll
  3. OtherThirdParty3.dll

(Required)

  1. MyProgram.exe
  2. MyProgram.exe.config
  3. MyMenu.xml
  4. Shared.dll

I'm running into an issue where my program errors out because it can't find any of the ThirdParty or OtherThirdParty DLLs. I checked where ClickOnce was installing these files and its putting it in a completely separate folder than my executable.

What's the point of creating different groups of files if they aren't saved in the same location? I'd like to use this so when my program updates, I don't have to download everything, just the changes. Some of these third party DLLs are 10-15 mb in size and I have up to 1000 clients with slow connections, so it's a lot of bandwidth and a big download for the clients.

开发者_开发百科

How should I set this up so when something changes in MyProgram.exe, I can make the client download the smallest amount of files possible (nothing from the ThirdParty and OtherThirdParty group)?


I can't address your issues with File Groups in ClickOnce - I've never used them. However, you shouldn't need to bother with them if your only concern is that the 3rd party dlls get downloaded once and only once.

ClickOnce intelligently downloads files based on their hashes. If anything about a file changes (date, size, contents, etc) its hash will change. When a ClickOnce application starts after a new version has been published, it compares all the file hashes from the client to the file hashes on the server and only downloads things that have changed.

As long as your 3rd party dlls aren't changing, the hash that gets generated for them will always be the same. So they should only ever be downloaded once.

One more thing, completely ignore the file size on the ClickOnce download progress bar. It always shows the full size of your app even if it's only downloading one file. If you want to test it yourself, use Fiddler to monitor what happens when a ClickOnce app starts.


FWIW, this article seems to explain the purpose of the ClickOnce File Groups:

http://thejoyofcode.com/ClickOnce_File_Groups.aspx

It looks like they're used when you have a large application for which you want the initial package to be a sort of bootstrapper, with subsequent parts of the app downloaded on-demand while the app is running.

0

精彩评论

暂无评论...
验证码 换一张
取 消