Could not load file or assembly. - Advanced Installer Community
supermario
Posts: 7
Joined: Mon Nov 03, 2014 11:37 am

Could not load file or assembly.

Hi,

This may not directly correlated with advanced installer but it still have direct correlation in deployment as general. I think some will have this issue at some point.
I have a project referenced to onvif.discovery.dll assembly. Please note I don't have the source of this assembly.

I reference into the project: system.reactive from nuget package with version 2.2.5.0. This project works fine in my working machine and all running well until I test it by deploy and install it on new computer.

I got error at one point when the program come to a routine which call odm.core.NvtManager (namespace under onvif.discovery.dll) as follow:
System.IO.FileLoadException: Could not load file or assembly 'System.Reactive.Linq, Version=2.0.20823.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'System.Reactive.Linq, Version=2.0.20823.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
at odm.core.NvtManager..ctor()
It seems that onvif.discovery.dll reference to old version of system.reactive.linq of 2.0.20823.0 instead of 2.2.5.0.
I am trying to look at into my project reference and nothing found with 2.0.20823.0 version. I look at into my bin folder also to make sure any system.reactive.linq dll is 2.2.5.0 version. I confuse that my working machine works fine, no reference to 2.0.20823.0 version i find so far. So why my target machine didn't work?

If in my working machine the onvif.discovery.dll keep pointing to old version, why my project running well in my working machine? And I don't know whether it is possible for a project reference to same assembly with different version.

I am trying twice to import visual studio project to new advanced installer setup project, but still didn't work.

Looking for help how to fix it. Thanks.
supermario
Posts: 7
Joined: Mon Nov 03, 2014 11:37 am

Re: Could not load file or assembly.

Ok, after a day headache I got finally make it work.
I need to include the app config file into files and folders. This config file describe the assembly binding. The old version will redirect to the new version.
Otherwise, the target machine will keep looking for the old version.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Could not load file or assembly.

Hi Mario,

I'm glad you got this working by yourself.
Thank you for sharing this with us. I'm sure it will help further users in the same situations.

If you other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”