Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > ClickOnce installing old assemblies from cache
 

ClickOnce installing old assemblies from cache

Hi,

I'm using ClickOnce for installing MyApp written in C#. Everything worked fine till last update after which start of MyApp ends with error saying "Could not load file or assembly MyAssembly... HRESULT: 0x80131040".

After some research I've found that there is an old version of MyAssembly located in MyApp's ClickOnce cache folder (c:\documents and settings..\Apps\2.0...). However there is an actual version in deployment package.

I've also found this old version of MyAssembly in standalone directory in ClickOnce cache named after this assembly (plus some characters added).

It seems to me that for some reason ClickOnce used this old version of MyAssembly from cache instead of new version from deployment package.

Uninstall/install of MyApp won't help.

How is this possible?

havlicekp  Tuesday, May 26, 2009 8:09 AM
ClickOnce always caches assemblies in separate folders, in addition to holding them in their own deployment folder. Is this assembly strongly named? Have you put out a new version of it, and not updated the version number? How is the assembly built, and how is it included in the ClickOnce deployment?

Have you tried uninstalling the ClickOnce application and reinstalling it?

Have you tried uninstalling the ClickOnce application, deleting the \apps\2.0 folder, and reinstalling it?

RobinDotNet


Click here to visit my ClickOnce blog!
RobinDotNet  Thursday, May 28, 2009 1:19 AM
Robin, thank you for your reply.

This assembly is strongly named.

I have put out a new version with updated assembly version number. In deployment package there is MyAssembly.dll with FileVersion 1.0.0.0 and AssemblyVersion 1.0.3432.32440. In ClickOnce cache there is MyAssembly with FileVersion 1.0.0.0 and AssemblyVersion 1.0.2775.22152. This old version from cache used ClickOnce when installing MyApp.

Could be the same FileVersion the reason?

In MyApp.exe.manifest I have

<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MyAssembly.dll" size="472576">
<assemblyIdentity name="MyAssembly" version="1.0.3432.32440" publicKeyToken="D66DE92CB5FE9CF3" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>UldLYhv7seDY5bsREFa+Xo02MH0=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>

Reinstall didn't help.

Deleting \apps\2.0 folder and ClickOnces's registry keys would probably help but I cann't ask MyApp's user for doing this.
havlicekp  Friday, May 29, 2009 1:34 PM
What if you make the file version the same as the assembly version? To be honest, I don't know the difference, we just always update both of them. This could be your problem.

Also, please do try what I mentioned before about deleting the cache. And also, when you say "in the clickonce cache", do you mean the folder that only contains that one dll (every assembly gets their own folder for versioning), or the one that contains all of the dll's and the exe file?

RobinDotNet
Click here to visit my ClickOnce blog!
RobinDotNet  Monday, June 08, 2009 1:49 AM
I've got the exact same problem. Did you find out why this happened? I don't even update the version number of my assembly, because from what I have heard dotNet should use the hash value when checking if the assembly is updated. The hash value is updated every time you rebuild in Visual Studio.

One other thing to note is that we get different behvaiuor on different machines. So one machine could have been nicely updated while another has a reference to an old dll (assembly). This makes it even more worrying though!
Fredrik Stigmarker  Thursday, August 27, 2009 5:47 AM
This appears to be a bug with .net framework 3.5 SP1

http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/37e20cec-933a-42a6-b5a2-890ab863b0b4
Fredrik Stigmarker  Thursday, August 27, 2009 6:12 AM

You can use google to search for other answers

Custom Search

More Threads

• Magic with Installations (Am I re-inventing the wheel)
• Updation of single dll in clickonce
• ClickOnce and App.config
• Upgrade Problems on Vista
• Updater Application Block
• adding installer class to project with setup already
• is thowto run a vb.net application without installing .net framework sdk...1.1
• Updater block error with "The client does not have sufficient access rights to the requested server object."
• Changing settings after publishing
• launch Condition in Web Setup Project