开发者

Upgraded to .NET 4.0 & getting Could not load file or assembly reference to old version of DLL that was removed

开发者 https://www.devze.com 2023-01-27 02:59 出处:网络
System.IO.FileLoadException: Could not load file or assembly \'FOO, Version=1.0.3975.20137, Culture=neutral, PublicKeyToken=2aec35e026e7fee4\' or one of its dependencies. The located assembly\'s mani

System.IO.FileLoadException: Could not load file or assembly 'FOO, Version=1.0.3975.20137, Culture=neutral, PublicKeyToken=2aec35e026e7fee4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: 'FOO, Version=1.0.3975.20137

I have a C# program that we constantly update and it gets reinstalled and it seems that since I've upgraded the project from VS2005 to VS2010 and .NET from 2.0 to 4.0 I'm getting this strange error where its trying to reference the old version of the dll from the last install.

When I go to the directory where its installed Prorgam Files(x86)/.... the latest version of the DLL is in there. In the code there are no references to the old DLL. The only way to fix this is to uninstall the program manually and reinstall. After that the program works fine.

I am lost and confused as to why it would want to keep referencing an old DLL version when its not even there. I have tried running fuslogvw.exe but it hasnt yielded any useful information. I also thoug开发者_运维百科ht it was possibly the setup project to I deleted and recreated one from scratch. I've also done the usual clean solution & rebuilding. I've searched all thru the forums and online but most people seem to have a problem where the old version of their DLL is still in the program directory and the new DLL didnt get installed. My problem is the opposite.


I've had this error appear when the Clean action for some reason forgets to remove all the dlls in my project's bin directory, and I've had to manually delete those dlls. You might want to check that all the relevant dlls are getting removed as part of the update process. I'm guessing that's what happens when the program gets uninstalled, which is why it works then.


I would start with Who deployed the last breaking version.

It's possible that their machine incorrectly references a bad / old version, whether in the GAC or a hangover from a BIN directory. Also, you mention reinstalling "manually".. Does this mean that you have some build server or other deployment automation in place? It's possible the assembly reference is being picked up by it.

Basically, you'll need to track down exactly how the bad app is being deployed to that machine and fix it.

0

精彩评论

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

关注公众号