Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Using DownloadFileGroup to force an update of an optional DLL
 

Using DownloadFileGroup to force an update of an optional DLL

Hi,

Can anyone tell me if it is possible to force a download of an optional dll that has already been installed but has now changed without changing the version of the entire application.

We are building a very large application which consists of many separate optional assemblies. If we wish to apply a hotfix to a single assembly I don't want to have to increment the project version number as this seems to force a download of all assemblies again even though only one has changed (I am not sure that this behaviour is correct from what I have read but it seems to be what happens). This would obviously be a large overhead over an internet distributed application.

I have the ability to check the version number of the hosted assembly vs the locally cached one and I was hoping that by making a call to DownloadFileGroup again would refresh the group for me (each assembly is defined as a group in its own right). This doesn't seem to happen though - the code executes and succeeds but the dll remains the same version.

Is there any way of achieving what I am trying to do using ClickOnce or do I have to go away and create my own distribution framework?

Regards

Jeremy

Jeremy Faulkner-Court  Monday, July 16, 2007 10:26 AM

Hi, Jeremy Faulkner,

For your problem, please read the following article first.

http://msdn2.microsoft.com/en-us/library/ms404267.aspx

As you can see, the ClickOnce deployment uses file patching technology to avoid redundant downloading.

And it will compare the the hash signatures to decide which update to download.

However, if you are using visual studio, it will generate new signatures every time you rebuild your project.

I think you can try to compile it your self like

Code Snippet
csc /target:exe /reference:ClickOnceLibrary.dll Form1.cs
vbc /target:exe /reference:ClickOnceLibrary.dll Form1.vb

More information, please read the following articles,
http://msdn2.microsoft.com/en-us/library/ms228997.aspx
http://msdn2.microsoft.com/en-us/library/xc3tc5xx.aspx


Hopes this helps,

Regards

Yu Guo â€?MSFT  Friday, July 20, 2007 3:29 AM

Hi, Jeremy,

What you want to do is Downloading Assemblies On Demand,

and here is an article talking about it.

http://msdn2.microsoft.com/en-us/library/ms228997.aspx

And it seems that you have done some research,

please post some codes to see if we can provide more suggestions.

Hopes this helps,

Regards

Yu Guo â€?MSFT  Thursday, July 19, 2007 9:30 AM

Hi Yu,

I am using download on demand and that works great. The thing I am trying to get around is the following scenario really:

A system containing lots of assemblies (each one is a form in its own right which represents a menu item and is called using late binding).

If I release version 1.0.0.0 for example, and it has 50 assemblies in it. Not everyone will use all of the assemblies and so each user only downloads the assemblies that are required - so far so good.

I now modify one of those assemblies which therefore has a new version number. If I redeploy the manifest with a new application version number 1.0.0.1 what happens is that any assembly that has previously been downloaded is downloaded on demand again because of the new application version number even though it hasn't actually changed at all ( I am not sure that this is working correctly according to the documentation as my interpretation was that it wouldn't download any assemblies that had not changed since the previous version). This means that all users will refresh all of the dlls that they are using instead of just the one dll that has been changed.

If i update the dll version by recompiling but rebuild the manifest with the same version number then the downloadfilegroup command doesn't seem to want to download it again even though the assembly itself now has a different version number.

What I am trying to achieve is that the application will recognise that the single dll has changed and download that but will not redownload all of the others again as this is an unnecessary use of bandwidth.

I hope that explains it a little better.

Regards

Jeremy

Jeremy Faulkner-Court  Thursday, July 19, 2007 3:21 PM

Hi, Jeremy Faulkner,

For your problem, please read the following article first.

http://msdn2.microsoft.com/en-us/library/ms404267.aspx

As you can see, the ClickOnce deployment uses file patching technology to avoid redundant downloading.

And it will compare the the hash signatures to decide which update to download.

However, if you are using visual studio, it will generate new signatures every time you rebuild your project.

I think you can try to compile it your self like

Code Snippet
csc /target:exe /reference:ClickOnceLibrary.dll Form1.cs
vbc /target:exe /reference:ClickOnceLibrary.dll Form1.vb

More information, please read the following articles,
http://msdn2.microsoft.com/en-us/library/ms228997.aspx
http://msdn2.microsoft.com/en-us/library/xc3tc5xx.aspx


Hopes this helps,

Regards

Yu Guo â€?MSFT  Friday, July 20, 2007 3:29 AM

Hi Yu,

Thanks for that. It looks interesting. That is exactly what I want it to do - only download things that are changed. It seems odd though as each dll is a separate project, compiled separately and then the manifest is built manually so I would have expected it not to have re-downloaded anything except the one dll.

I will have to investigate further as the behaviour mentioned above is what I would expect it to do and what I want.

Many thanks for your help.

Regards

Jeremy

Jeremy Faulkner-Court  Monday, July 23, 2007 11:12 AM
Jeremy, I have some problem and I'm not sure if you solved the problem.
I tried to follow the link but it's not clear how to do this.
All I want is to force download files from the file group if the file has changed on the server.
How can I do this?
Thanks.
chrisk414  Friday, August 28, 2009 6:03 PM

You can use google to search for other answers

Custom Search

More Threads

• Basic Script Access to Windows Form Controls In IE
• How to use MsgBox in c# for a class library
• 30day trial or demo version
• What do I have to buy/do to avoid Vista security prompts for Windows Services deployment?
• how delete tmp files in rollback
• IEExec.exe and running instance
• Obtaining Installer Platform from Installer Class
• How do I get the prerequisits to install from my Setup.msi?
• Launch application at end of setup
• How to install SQL Server 2005 Reporting Services on your Production box