01-07-2012 12:42 PM
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
01-09-2012 11:13 AM
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
01-23-2012 08:11 PM
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.
01-24-2012 10:06 AM
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.
01-27-2012 11:05 AM
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?
01-27-2012 11:15 AM
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.
01-29-2012 01:43 PM
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).
02-06-2012 05:53 AM
02-06-2012 04:07 PM
There a few things going on here that hopefully I can help clear up.
04-06-2012 10:46 AM
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