Server Error In '/' Application - Could Not Load File Or Assembly 'Microsoft.Exchange.Management' Or One Of Its Dependencies. An Attempt Was Made To Load A Program With An Incorrect Format.


Summary

This error is encountered due to a known bug in the installer which will be fixed in next update.

Applies To

MachPanel all versions

Symptoms

Error looks like this:


Server Error in '/' Application

--------------------------------------------------------------------------------

Could not load file or assembly 'Microsoft.Exchange.Management' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.BadImageFormatException: Could not load file or assembly 'Microsoft.Exchange.Management' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Cause

Known bug in the current installer.

Solution

To resolve this issue five Microsoft Exchange DLL files need to be replaced in bin folder of MachPanel installation directory (e.g. C:\Program Files\MachSol, Inc\MachPanel\bin).

Note:
Download and replace the following files i.e. 64-bit windows 2003 or 64-bit windows 2008.

MS Exchange Files include the following:
  1. Microsoft.Exchange.Management.dll
  2. Microsoft.Exchange.Diagnostics.dll
  3. Microsoft.Exchange.Data.dll
  4. Microsoft.Exchange.Data.Directory.dll
  5. Microsoft.Exchange.Configuration.ObjectModel.dll

Please download the files below and follow these steps.
Note: Links to download the files for 64-bit windows 2003 are placed at the end of this article
Note: You can also copy these 5 Exchange DLL files from bin directory of your respective Microsoft Exchange Server installation folder.

Step 1: Stop all MachPanel Services
  1. Go to Start >> Run
  2. Type services.msc and press Enter
  3. Microsoft Services Window will pop up
  4. In the right hand pane Click on or Navigate to MachPanel Provisioning Service
  5. Right click this service and then click Stop
  6. Repeat steps from 4 to 5 for all MachPanel services

Alternatively stop the MachPanel Services from the bin folder of MachPanel. Typically C:\Program Files\MachSol, Inc\MachPanel\bin, double click MachSol.MachPanel.StopServices.exe

Step2: Download and copy files
  1. Extract the files you downloaded from our website.  [download from within this KB, files are attached to this article]
  2. Copy downloaded files and paste them to bin directory location typically, C:\Program Files\MachSol, Inc\MachPanel\bin

Step 3: Start all MachPanel Services
  1. Go to Start >> Run
  2. Type services.msc and press Enter
  3. Microsoft Services Window will pop up
  4. In the right hand pane Click on or Navigate to MachPanel Provisioning Service
  5. Right click this service and then click Start
  6. Repeat steps from 4 to 5 for all MachPanel services

Alternatively Start the MachPanel services again from the bin folder of MachPanel. Typically C:\Program Files\MachSol, Inc\MachPanel\bin, double click MachSol.MachPanel.StartServices.exe

Note: (This procedure is usually not required)
If problem is not resolved, try the same procedure on Remote Server.