简体   繁体   中英

“The located assembly's manifest definition does not match the assembly reference” after installing new version

I have created a Windows Forms desktop application using VS 2015 in Win 10. When I release a new version I would like users to be able to run the installer without first uninstalling any earlier versions. To do this, I create a new Product code in the General Information tab of InstallShield LE, which is included in VS 2015. This appears to be the only way of having new versions install over old ones. The detailed descriptions provided by InstallShield on how to create updated versions using the UpdateCode do not seem to work. After installation, the old and new versions are present in the list shown in Control Panel-> Programs and Features.

I created a new self-extracting .exe installer for a new version containing a reference to Global Version 2.1.68, but when I run it in a Win 7 environment on a different machine where an earlier version (2.1.62) referencing the assembly Global Version 2.1.62 has been installed and open a particular form, I get an Exception message

Could not load file or assembly 'Global, Version = 2.1.62.0, Culture = Neutral, PublicKeyToken=a95f9488c29' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.

Exception Text:

System.IO.File.LoadException: Could not load file or assembly 'Global, Version = 2.1.62.0, Culture = Neutral, PublicKeyToken=a95f9488c29 at ...

If I uninstall Version 2.1.62 via Control Panel and install Version 2.1.68 of the application, the error does not occur.

I have checked the C# references to the Global dll and they all point to the updated dll.

I would like users to be able to install new versions without first having to uninstall old ones, but it appears that something from the V 2.1.62 install is carried over to the newer install and tries to locate the old version of Global.dll

问题是我没有更新引用global.dll的子项目的版本号,因此新版本的安装没有更新那个dll,后者继续寻找旧的(v 2.1.62)版本的global.dll。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM