Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot update Common assembly from 8.1 to 8.6

Solved!
Go to solution

Hello,

 

I am developing C# code to directly interface with my NI DAQs.  There are some excellent code examples for .NET bundled with the DAQmx drivers; for example AcqOneVoltageSample.2005.

 

Unfortunately, I recently updated my DAQmx, which updated the  NationalInstruments.Common assembly from 8.1.20.616 to 8.6.35.131.  Not surprisingly, when I try to reopen any of the .NET example projects, like the AcqOneVoltageSample.2005, a dialog box with the National Instruments logo pops up titled "Update Project References" and asking me to verify that I update teh referenced version of NationalInstruments.Common from 8.1.20.616 to 8.6.35.131.  I say "Yes", and verify that the assembly referenced in the solution indeed has been changed to 8.6.35.131.

 

But now, the solution will not compile.  Specifically, the compiler (Visual Studio 2008, compiling under NET2.0) throws two errors:

1) The type "NationalInstruments.ISynchronizeCallbacks" is defined in an assembly that is not referenced.  You must add NationalInstruments.Common version 8.1.20.616

2) The type "NationalInstruments.ISupportSynchronizationContext" is defined in an assembly that is not referenced.  You must add (ditto above).

Both errors refer to the code that instantiates the DAQmx.Task object, even though it is defined in Common version 8.6.

 

I've verified that the newer 8.6 version of Common is correctly referenced.  When I delete that reference and add the old 8.1 version it compiles fine.  I've tried rebuilding the solution, deleting the .bin and .obj directories and rebuilding, checking the "copy local" option when referencing the 8.6 version....nothing works.  I don't see anything special in the assembly.cs.  I can compile using the latest NationalInstruments.DAQmx assembly 8.7.20.11, just not the newest NationalInstruments.Common assembly.

 

How can I get the .NET example files for Visual Studio 2005 to compile with the newest versions of NationalInstruments.Common against the .NET2.0 library?

 

Thanks,

 

- Jim

0 Kudos
Message 1 of 7
(4,843 Views)

Perhaps this is a clue:

 

Things went south after I added Measurement Studio, which I don't need for the simple example project I am compiling.

 

Two assemblies are referenced.

The NationalInstruments.Common 8.6.35.131 is in C:\Program Files\NI\MeasurementStudioVS2008\DotNet

The NationalInstruments.DAQmx 8.7.20.11 is same as above but VC:\Program Files\NI\MeasurementStudioVS2005\DotNet

 

I didn't take a close look at the National Instruments folder before adding Measurement Studio, but it does seem a bit of an assembly mess now.  There are two folders, one for MeasurementStudioVS2005 and one for 2008, each having a DOTNet folder.  Under each of those are three other folders: two for different versions and one for common, giving a total of 6 places for assemblies to reside.  Of these 6 places, the .Common is found in 4 of them, in a total of two different versions, and the DAQmx is found in a partially overlapping set of 4 of them, in a total of two different versions.

 

Things compile fine using the old (8.1) or new (8.7) version of DAQmx, but only using the old (8.1) of the Common.

 

My question is: should be I content that things compile and run with Common version 8.1, or should I try to get things to run with the version that the National Instruments popup keeps trying me to re-reference whenever I open a solution: the Common 8.6?  I'd be less concerned if not for NI's choice to keep telling me to update my references each time I open the solution, making me think there's a good reason to use the latest assemblies.

0 Kudos
Message 2 of 7
(4,835 Views)

...just to be sure, I tried adding the

Common v8.6 and

Common.Native v8.6

 

but same problem; compilation error saying "add Common 8.1".  When I remove the above references and use 8.1, all is well except for the NI "Update Project References" dialog box that keeps appearing whenever I open the solution.  

0 Kudos
Message 3 of 7
(4,826 Views)
Solution
Accepted by Jim415432

Jim,

 

After installing Measurement Studio did you reinstall the DAQmx Driver? You will need to reinstall the drive and ensure that you select to install support for Measurement Studio.

 

-Adri

Adri Kruger
National Instruments
LabVIEW Product Marketing
Message 4 of 7
(4,807 Views)

Adri,

 

Yes, you have addressed the heart of what turns out to be a circular problem.  I am using the latest version of Visual Studio (2008) and building applications for the most-commonly deployed version of .NET (version 2.0).  I would think this would be a very common scenario - latest version development tools building for customers with one-level-behind-latest-version NET foundation.

 

When I attempt to re-install the DAQmx drivers for NET2.0 from the newest NIDAQ 8.9 download I get the error message "Not possible unless you first install Measurement Studio .NET2.0 Language Support - Visual Studio Integration".  Makes sense.

 

Unfortunately the Measurement Studio CD will not allow this combination: it will allow you to install .NET3.5 Language Support if you have Visual Studio 2008, or .NET2.0 language support if you have Visual Studio 2005, but not .NET2.0 if you have Visual Studio 2008!  Specifically it says "You must have Visual C# 2005 installed for this feature to work properly" and then will only allow a "cancel" install.

 

So, how do I allow the latest version of Visual Studio to run with the latest version of DAQmx when compiling against the NET2.0 libraries?  I really don't want to downgrade my compiler back to Visual Studio 2005.

 

Thanks,

 

- Jim

 

 

Message Edited by Jim415432 on 02-20-2009 10:52 AM
0 Kudos
Message 5 of 7
(4,803 Views)
Message Edited by Jim415432 on 02-20-2009 10:52 AM
0 Kudos
Message 6 of 7
(4,802 Views)

Adri,

 

I am sorry; it is indeed possible.  To install support for VS2008 to compile to .NET 2.0 one must

 

1) Choose "add support for VS2005 with user options" then uncheck "integrate with VS2005" but check everything else AND

2) Choose "add support for VS2008"

#1 adds NET2.0 support, #2 integrates with VS2008.

 

Thanks for your help,

 

- Jim

0 Kudos
Message 7 of 7
(4,794 Views)