Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

'NationalInstruments.ISupportSynchronizationContext error when moving code to other machine

Hello,


I have an WPF application that uses a daq a camera and thus needs to reference following dlls:

  • NationalInstruments.Common
  • NationalInstruments.DAQmx
  • NationalInstruments.Vision.Acquisition.Imaq
  • NationalInstruments.Vision.Common

I built it in a PC running Windows 10 and Visual Studio 2015 Comunity and it runs perfectly.

After that, I deployed the application on a new machine running Windows 7 and Visual Studio 2015 Comunity and it worked great.

 

Now I need to put the app on a third computer running Windows 7 and Visual Studio 2013 Express and I can't find a way to make it compile.

Both machines have the same versions of the dlls installed:

  • NationalInstruments.Common
    • Version: 15.1.40.49152
    • Path: C:\Program Files (x86)\National Instruments\MeasurementStudioVS2012\DotNET\Assemblies\Current\NationalInstruments.Common.dll

  • NationalInstruments.DAQmx
    • Version: 15.5.45.109
    • Path: C:\Program Files (x86)\National Instruments\MeasurementStudioVS2012\DotNET\Assemblies\Current\NationalInstruments.DAQmx.dll

  • NationalInstruments.Vision.Acquisition.Imaq
    • Version: 4.60.35.49153
    • Path: C:\Program Files (x86)\National Instruments\MeasurementStudioVS2008\DotNET\Assemblies\Current\NationalInstruments.Vision.Acquisition.Imaq.dll

  • NationalInstruments.Vision.Common
    • Version: 13.1.35.100
    • Path: C:\Program Files (x86)\National Instruments\MeasurementStudioVS2008\DotNET\Assemblies\Current\NationalInstruments.Vision.Common.dll


But I keep getting the same error from my Imaqsession variable when trying to compile the code:
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'...

 

I tried to run the Ring/2008 example and it didn't work by the same reason and I read online that I needed to changed the NI.Comon dll to the one that matches the Imaq dll and that solved the error.


Went back to by application and changed the NationalInstruments.Common from V.15.1.40.49152 to 13.5.35.173 that is on the VS2008 folder like the Imaq ones but that causes the DAQ Task varaible to raise the same error for a diferent driver version.

 

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

 

and also

 

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


I tried all combinations of the versions available in the PC and none seem to work, I updated everything I could remember, NIDAQ,VAS and VISA. Both applications target .NET 4.5.2.

I also tried to run the code that I had compiled before and that I knew that work but not even that runs.

All the best,
Alexandre

 

0 Kudos
Message 1 of 2
(3,501 Views)

Hello orgerlab,

 

For me there are 2 possible solutions :

 

1) Resolve the assembly conflict using these 2 links >>http://digital.ni.com/public.nsf/allkb/17146CC2A32D47338625712D005E4CC8

>>http://digital.ni.com/public.nsf/allkb/8BFEF5404294B044862577990059551B

2) Create an installer instead of an exe to avoid this kind of issue : http://www.advancedinstaller.com/user-guide/tutorial-ai-ext-vs.html

 

Best regards,

 

Dasso

0 Kudos
Message 2 of 2
(3,454 Views)