06-06-2011 05:25 PM
I am trying a first C# express program using NI488.2 version 2.8.1 which I just installed.
My application gives a compile error
Error1The 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'.E:\src\1 -
C++ C# Express\Work\StevesTestApp\StevesTestApp\Form1.cs3524StevesTestApp
It looks like it wants NationalInstruments.Common ver 8.7.35.131.
The version of NationalInstruments.NI4882 is 8.9.35.104
The version of NationalInstruments.Common.Native is 8.9.35.302
Here is all I have avaliable for the common dll after the install:
8.9.20.302
8.9.35.302
The only Nationalinstruments.NI488.dll version I have seems to be 8.9.35.104 looking in C:\Program Files\National Instruments\MeasurementStudioVS2008.
Where do I get the correct assembly or cause it to like the versions I have?
thanks.
06-07-2011 01:07 PM
Well I should have searched a little more before asking.
This thread suggests the solution:
I reinstalled NI488.2 ver 2.8.1 and carefully selected support for .NET 2010 version 4. I installed the patch mentioned in the thread above. Then I removed all the NI referecnces from my project and added them back in from C:\Program Files\National Instruments\MeasurementStudioVS2010\DotNET\Assemblies.
The final change was in Visual Studio I needed to change:
Project>App Properties>Application>Target framework to ".Net Framework 4" from the default ".NET Framework 4 Client Profile". I'm not sure why that last change was neccessary but it wouldn't compile with out doing it. This seems to have fixed my problem.