Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How to merge two applications, one with VisaNS ver 8.9.35.108 and the other with NI4882 version 8.1.20.119

Solved!
Go to solution

Working application #1 is built with Common ver 8.1.20.168 and NI4882 ver 8.1.20.119

 

Working application #2 is built with Common ver 8.7.35.131 and VisaNS ver 8.9.35.108

 

When these are merged into a new application #3, apparently only one of the Common.dll files can be used...

 

If the older Common.dll is used, VisaNS routines fail because they require ver 8.7.35.131

If the newer Common.dll is used, the NI4882 routines fail because they require ver 8.1.20.168 

 

What would be the best way to get the merged application working?

 

0 Kudos
Message 1 of 4
(4,507 Views)

Hi garyhibb,

 

Unfortunately, you will have to use a single version of the common dll in your common application.  However, you should be able to successfully run the application using the newer common.dll, since the dll is designed to be backwards compatible.  What exactly are you seeing when you try to compile the merged application?  If you are seeing a warning, it is safe to disregard due to policy file relinking, as mentioned in the following article:

 

KnowledgeBase 3UQHBA00: Building a Measurement Studio Project in Visual Studio 2005 Results in Warni...

 

If you are unable to compile at all, please provide a bit more detail on what errors you are getting, and we can work from there.

Al B.
Staff Software Engineer - TestStand
CTA/CLD
0 Kudos
Message 2 of 4
(4,479 Views)

The errors that occur when compiling the application are shown below:

 

With Common version 8.7.35.131, NI4882 version 8.1.20.119 and VisaNS version 8.9.35.108:

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=8.1.20.168, Culture=neutral, PublicKeyToken=4544464cdeaab541'.

C:\CSharp_test\GCN\GCN\GPIB_Instrument.cs 15 50 GCN

Error 2 The type 'NationalInstruments.ISynchronizeCallbacks' is defined in an assembly that is not referenced.

You must add a reference to assembly 'NationalInstruments.Common, Version=8.1.20.168, Culture=neutral, PublicKeyToken=4544464cdeaab541'.

C:\CSharp_test\GCN\GCN\GPIB_Instrument.cs 15 50 GCN

 

With Common changed to version 8.1.20.168:

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=8.7.35.131, Culture=neutral, PublicKeyToken=18cbae0f9955702a'.

C:\CSharp_test\GCN\GCN\Form1.cs 29 63 GCN

Error 2 The type 'NationalInstruments.ISynchronizeCallbacks' is defined in an assembly that is not referenced.

You must add a reference to assembly 'NationalInstruments.Common, Version=8.7.35.131, Culture=neutral, PublicKeyToken=18cbae0f9955702a'.

C:\CSharp_test\GCN\GCN\Form1.cs 29 63 GCN

0 Kudos
Message 3 of 4
(4,464 Views)
Solution
Accepted by topic author garyhibb

Hi Gary,

 

Thanks for the additional information!   It looks like the problem here is that the 4882 version you are referencing depends on the .NET 2.0 version of the common assembly while the VISA version is referencing the 3.5 version.  Tofix this, you will need to either reference a newer version of the 488.2 assembly (recommended) or an older version of VISA assembly.  If you install the latest version of NI-488.2, you will be able to reference the newer assembly, allowing you to successfully run your application with the newer common assembly.

 

 

Al B.
Staff Software Engineer - TestStand
CTA/CLD
0 Kudos
Message 4 of 4
(4,447 Views)