.NET Error That Assembly Has a Higher Version Than Referenced

Updated Apr 9, 2018

Reported In

Software

  • Measurement Studio Professional

Issue Details

My .NET application generates the following error:

Assembly has a higher version than referenced.

How do I create the correct reference and remove the incorrect reference?

Solution

To correct this, delete the reference from Solution Explorer. For example, if your error reads, 

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'

The error suggests that your assembly WIAlib is referencing the NationalInstruments.UI assembly version 9.1.40.204. 

Measurement Studio .NET class library version numbers use the format <major version>.<minor version>.<framework version>.<build number>, where:
  • <major version> specifies the major version of the primary product that ships the assembly.
  • <minor version> specifies the minor version of the primary product that ships the assembly.
  • <framework version> specifies the version of the .NET Framework associated with the version of Visual Studio that the class library supports; for example, a value of 40 corresponds to .NET Framework 4.0 and indicates that the assembly is part of Measurement Studio support for Visual Studio 2010.
  • <build number> specifies a number that is incremented each time the assembly is built; the greater the value, the newer the assembly.

For example, the version number 9.1.40.204 in the error message tells us the following:
  • <9.1> = Measurement Studio 2010
    <.40> = .NET Framework 4.0
    <.204> = build version

  To resolve this assembly version mismatch, delete the following reference:

Once deleted, right-click References, select Add Reference..., and then select the correct assembly version under the .NET tab (National Instruments User Interface Library version 9.1.40.204 and National Instruments Windows Forms Controls version 9.1.40.204).

WAS THIS ARTICLE HELPFUL?

Not Helpful