Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

NationalInstruments.Common 9.0.40.362 missing

 

Hello..

I've been searching and cannot find an answer to my problem attempting to use the NI-488.2 Net Libraries

 

I recently installed VC# 2010 Express and the latest NI-488.2 Ver 3.0.  When installing NI, I requested the .net 4.0

support files to be loaded.

 

While setting  the C# 2010 build properties to target .net 4.0 (or 4.0 client) I set the VC# app references to use:

NationalInstruments.NI488.2        Ver 9.0.40.157  (I assumed 40 stood for .net 4.0)

 

Upon building the app, I get an error:

Error    1    The type 'NationalInstruments.ISupportSynchronizationContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'NationalInstruments.Common, Version=9.0.40.362, Culture=neutral, PublicKeyToken=dc6ad606294fc298'.

 

So now I add another reference to NationalInstruments.Common but the version installed  is  Ver 9.1.40.159


Building the app this time I get a warning : Warning  Found conflicts between different versions of the same dependent assembly. 

 

I'm confused and could use some help.  Do I have an issue that should be resolved? In particular, I am not sure which references are required for which Target Framework. 

Any help would be appreciated.

 

Jim

 

Message 1 of 14
(9,993 Views)

Hi jflanagan,

 

The third number does stand for the version of .NET framework being used.

The NationalInstruments.Common is common to all our assemblies. You should use the more recent version and make sure that you only have one version referenced in your assembly. This link should show you how to delete the reference to the earlier version of the Common library (http://msdn.microsoft.com/en-us/library/wkze6zky%28v=VS.100%29.aspx).

 

Please just use the NationalInstruments.Common version 9.1.40.159 that was required by NationalInstruments.ISupportSynchronizatinoContext.

 

A screen shot of all your current references might be helpful if that doesn’t work.

 

Regards,

 

Michael M

NI Americas | AE

0 Kudos
Message 2 of 14
(9,983 Views)

I'm experiencing the same problem.  I have NationalInstruments.Common version 9.1.40.159 installed and referenced and am running Visual Studio 2010 and keep getting the error: "'NationalInstruments.ISynchronizeCallbacks' is defined in an assembly that is not referenced. You must add a reference to assembly 'NationalInstruments.Common, Version=9.0.40.362, Culture=neutral, PublicKeyToken=dc6ad606294fc298'.

 

I'm stuck until this problem is resolved.

0 Kudos
Message 3 of 14
(9,950 Views)

Hi,

 

I had a similar problem with my program. It has been solved by forcing the target platform to x86 instead of Any CPU. The explanation was found somewhere on the forum.

 

Hope this can help,

Regards,

Florent.

0 Kudos
Message 4 of 14
(9,943 Views)

I'm having this exact problem in a C# .NET 4.0 program. Setting the target to x86 doesn't resolve it. Are there any other known solutions?

0 Kudos
Message 5 of 14
(9,925 Views)

Update: The problem was solved with the solution from this thread: http://forums.ni.com/t5/Measurement-Studio-for-NET/problem-with-488-2-and-vb-net-4-0/td-p/1800956

 

I only had to change the target framework from the Client Profile to the full 4.0 framework.

0 Kudos
Message 6 of 14
(9,924 Views)

For Visual Studio 2010, the National Instruments DLL versions are:

NationalInstruments.Common = 9.1.40.159,

NationalInstruments.NI4882 = 9.0.40.157

 

Evidently, National Instruments built their .NI4882 DLL using the older version of .Common DLL (9.0.40.362).

To fix the version conflict, the .NI4882 DLL needs to be recompiled using the 9.1.40.159 .Common DLL.

The .NI488 DLL source code is required to do this, so National Instruments is the only one to fix this properly.

 

As a work around for this error:

Add the DLL "references" of VS2010 .Common and .NI488 into your Visual Studio project (what you normally do).

Compile the project.

A warning message will be issued, "Found conflicts between different versions of the same dependent assembly..."

Double-click the warning.

An info box pop's up asking if you want to "...add binding redirect records in the app.config file".

Choose "Yes".

An app.config file will be added to your project.  This file essentially tells the compiler to use the 9.1.40.159 version instead of the 9.0.40.362 version of the .Common DLL.

Be sure to add the "app.config" file to your version control files of the project (for those who do selective version control).

0 Kudos
Message 7 of 14
(9,908 Views)
I share the same problem: The released .NET assemblies require version which are not provided with the release. The idea of overriding the assembly versions does not work for me: VS already complains on compiling about the missing assembly version and offers not the provided option to override the version mismatch. Is there any chance to fix this properly? Or any tool for _patching_ the DLLs so that they match? Or a download location which contains a valid set of .NET libraries?
0 Kudos
Message 8 of 14
(9,861 Views)

There a few things going on here that hopefully I can help clear up.

 

  1. You can always use a later version of Common with your NI assemblies than what the assembly was built against. In this case, the NI4882 assembly was built against the 9.0.40.362 version of Common in a previous release of NI-488.2. The NI-488.2 driver then had a new release, but the .NET API did not have any updates. Therefore, the same NI4882 assembly was included in the NI-488.2 3.0 driver installer, but we also packaged the latest version of Common in the installer because there were bug fixes that we wanted to release.
  2. This is actually very typical with our assemblies and we have a section in our help that addresses this scenario. Refer to the Updating Measurement Studio .NET Applications help topic in the Measurement Studio Help (installed with .NET API even if you do not have Measurement Studio). There is a section that describes the process for resolving these errors if you have Measurement Studio Integration installed and on if you do not have Integration installed. You will not need to follow the instructions regarding the license file unless you are using licensed Measurement Studio controls and not just the NI4882 assembly.
  3. If you have Measurement Studio Integration installed, then you will not receive an error, but just a warning. Double-clicking this warning will bring up a dialog that will help you automatically create an app.config file as phmoore has described. If you do not have Integration installed, you will actually receive error messages.
  4. If you are using the .NET 4.0 Client Profile instead of the full .NET framework, you will also receive the same error messages as dpm5109 described.
National Instruments
0 Kudos
Message 9 of 14
(9,829 Views)

Is there any way to get around the error without using licensed Measurement Studio Integration? I have ensured that I am using the full .Net framework and not just the client profile. I have no option to resolve the error. 

 

Thanks,

Chris

0 Kudos
Message 10 of 14
(9,687 Views)