Assembly Has a Higher Version Than Referenced .NET Error

Updated Feb 5, 2024

Reported In

Software

  • Measurement Studio

Issue Details

When I compile or try to call a .NET assembly in my application, I get a .NET error in following format: 

Assembly '<Name>, Version=<X.X.X.X>, Culture=<>, PublicKeyToken=<>' 
uses 
'<DLL Name>, Version=<Y.Y.Y.Y>, Culture=<>, PublicKeyToken=<>' 
which has a higher version than referenced assembly 
'<DLL Name>, Version=<Z.Z.Z.Z>, Culture=<>, PublicKeyToken=<>'.

Solution

This error indicates that there is a version mismatch between what is referenced by the assembly (<Y.Y.Y.Y>) and what the project is pointed towards (<Z.Z.Z.Z>). To correct this, you need to re-add the correct reference in Solution Explorer. 
 
  1. Confirm that the DLL version <Y.Y.Y.Y> is present on your computer. Refer to NI .NET Assemblies Needed to Deploy Applications to determine the DLL location and for more information if your application includes a device driver API.
  2. Delete the <DLL Name> reference indicated in the error from Solution Explorer. 
  3. Right-click References >> Add Reference... 
 

 
  1. Select the correct assembly version under the .NET tab as indicated in <DLL Name Y.Y.Y.Y>. 

For example, 
Assembly 'WIAlib, Version=3.13.0.0, Culture=neutral, PublicKeyToken=null' 
uses 
'NationalInstruments.UI, Version=9.1.40.204, Culture=neutral, PublicKeyToken=dc6ad606294fc298' 
which has a higher version than referenced assembly 
'NationalInstruments.UI.WindowsForms, Version=9.0.40.292, Culture=neutral, PublicKeyToken=dc6ad606294fc298'


indicates that the project is currently pointed towards an older version of NationalInstruments.UI. You need to remove NationalInstrument.UI from Solution Explorer and add reference National Instruments User Interface Library version 9.1.40.204 and National Instruments Windows Forms Controls version 9.1.40.204.