Can't load Assembly after install - Advanced Installer Community
jpeterson
Posts: 10
Joined: Thu Mar 27, 2014 2:30 am

Can't load Assembly after install

I am evaluating Advanced Installer for replacing our current Click-Once installer. The target of the installer is a VSTO Outlook Add-In using C# 4.5. I used the Advanced Installer project wizard to successfully create an MSI installer, but when a particular section of code from the Add-In is executed it causes the following exception:

Code: Select all

System.IO.FileLoadException was unhandled by user code
  HResult=-2146234304
  Message=Could not load file or assembly 'System.Reactive.Interfaces, Version=2.1.30214.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)
  Source=Recon
  FileName=System.Reactive.Interfaces, Version=2.1.30214.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35

I don't know why it is trying to load version 2.1.30214.0 as my project is configured to use version 2.2.2. When I launch the Add-In from the Visual Studio Debugger, the code works. When I run Outlook after installing the Add-In with our existing Click-Once installer, the code works. It just doesn't work when the Add-In is installed from the installer created using Advanced Installer.

The code in question is the following line:

Code: Select all

WampSharp.DefaultWampChannelFactory channelFactory = new WampSharp.DefaultWampChannelFactory();
I am using WampSharp version 0.49-alpha (From Nuget).

I am not sure if it matters, but this code is executed from a background worker thread through the following execution chain:

Code: Select all

System.ComponentModel.BackgroundWorker backgroundWorker = new System.ComponentModel.BackgroundWorker();
backgroundWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.bw_DoWork);
backgroundWorker.RunWorkerAsync();
--> bw_DoWork()
----> WampSharp.DefaultWampChannelFactory channelFactory = new WampSharp.DefaultWampChannelFactory();
I have tried downgrading to version 2.1.30214.0 of the Rx assemblies, but then the code doesn't work when launched from the Studio Debugger. I get a very similar error as before, except it is complaining that it can't load version 2.2.2.

Why would the code work when installed using Click-Once but not when installed using Advanced Installer? What other details can I provide that will help identify the problem?

Kind Regards,

Joy Peterson
jpeterson
Posts: 10
Joined: Thu Mar 27, 2014 2:30 am

Re: Can't load Assembly after install

I have found the problem.

I failed to include MyAddIn.dll.config in the files that need to be installed. This file contained the following reference to System.Reactive.Interfaces:

Code: Select all

      <dependentAssembly>
        <assemblyIdentity name="System.Reactive.Interfaces" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
      </dependentAssembly>
Without this configuration setting, WampSharp was trying to use an older version of System.Reactive.Interfaces.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Can't load Assembly after install

Hello and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

I'm glad you found the root cause of the related behavior. If there is anything we can help you with just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”