views:

321

answers:

2

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?

A: 

Make sure this old assembly is loaded. You can use DllProfiler for that.

Irek
+1  A: 

Hi Peter!

I have had the same behaviour. It mentioned the problem in another thread. Since then, it has happened several times for us with different applications. One strange thing is that it behaves differntly on different computers. So one computer could have been updated with the new assembly while another got the old one copied.

http://stackoverflow.com/questions/792447/net-clickonce-deployment-and-wrong-assemblies-called-after-updated-version

This appears to be a bug in .net framework 3.5 SP1.

See microsoft KB 971052

/Fredrik

Fredrik Stigmarker
Thank you Fredrik
Petr Havlicek