Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated

Archived: How Can I Target the .NET 2.0 Framework from Measurement Studio 2009 for Visual Studio 2008?

This document has been archived and is no longer updated by National Instruments

Primary Software:
Primary Software Version: 2009
Primary Software Fixed Version: N/A
Secondary Software: N/A

I'm trying to build an application in Measurement Studio 2009 for Visual Studio 2008.  I want to target and deploy to computers that have the .NET 2.0 Framework on them.  What do I need to do to accomplish this?

First, you need to ensure that the following options are configured for the 2.0 Framework:
  1. In the Application tab of the Properties of your main project, set Target Framework to .NET Framework 2.0.

  2. In the Properties of your Setup Project, click the Prerequisites button to launch the Prerequisites dialog. In this dialog, disable .NET Framework 3.5 and enable .NET Framework 2.0.

  3. Double-click Microsoft .NET Framework under Detected Dependencies in your Setup Project to launch the properties window.  Change the Version property to the 2.0 Framework.

Once the configuration is complete, you will also need to alter the references in your main project.  It is important to note that Measurement Studio will overwrite the changes you make to the references if you add controls or update the references.  Therefore, it is important to make the following changes each time before you build your executable:
  1. Take note of all the references in your Project that begin with NationalInstruments.

  2. Remove these references.
  3. Right-click on References and choose Add Reference.
  4. For each of the references you removed, select the 2.0 Framework version of it in this list.  The 2.0 version of National Instruments Common is shown below.  Note: The ".20" in the string "Version" is the indication that this is the 2.0 Framework version.

If you do not see the 2.0 Framework versions here, you will need to install Measurement Studio 2009 for Visual Studio 2005.  You can do this by running the installer for Measurement Studio 2009.  Note that you do not need to install Visual Studio integration if you do not have Visual Studio 2005 or if you do have Visual Studio 2005 but you do not want to develop Measurement Studio applications with it.  The only reason for this installation is to get the 2.0 Framework versions of these assemblies.

After installing this, you should be able to add the references as specified in step 4 above.

The reason that this reference replacement is necessary can be traced back to a change in the .NET Framework.  The 2.0 Framework did not have an assembly called System.Core.  However, this was added in a later version and the National Instruments assemblies built for 3.5 leverage this assembly.  Therefore, when these are deployed on a target machine with only the 2.0 Framework, this assembly is missing and a crash occurs.

Related Links:
Product Manuals: Measurement Studio User Manual


Report Date: 04/22/2010
Last Updated: 11/21/2012
Document ID: 58LDT4US

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit