Deploying Measurement Studio Network Variable Applications

Measurement Studio 2012 for Visual Studio 2010 Help

Edition Date: August 2012

Part Number: 372636F-01

»View Product Info
Download Help (Windows Only)

See Also


Note: This topic applies to the following Measurement Studio editions: Enterprise and Professional.

The Measurement Studio NationalInstruments.NetworkVariable class library does not support XCOPY deployment because XCOPY deployment requires some support files to be installed on the machine that runs the application. Because of this, you must deploy applications that use the NationalInstruments.NetworkVariable class libraries in a different way. Refer to the following sections below for information about deploying applications that use the NationalInstruments.NetworkVariable class libraries. In this topic, the phrase target machine means the machine to which you are installing the application.

You can deploy applications that use network variables in two ways, depending on the location of the network variables with respect to the target machine. Client deployment is a deployment scenario where the application uses network variables hosted on another machine. Server deployment is a deployment scenario where the target machine hosts the network variables.

Client Deployment

In this scenario, you create an application that accesses variables on an existing server. You need to deploy the client application to other machines that continue to use the existing network variables. For this case, you can use a Microsoft Visual Studio setup project. The Visual Studio setup project automatically detects the dependant merge modules.

Server Deployment

In this scenario, you need to deploy the Shared Variable Engine to another machine that acts as the server. To deploy the Shared Variable Engine, you must run a separate installer on the target machine. The required installer is installed with Measurement Studio to the [InstallDir]\ Redist\NINETVARSERV folder.

You can view all command line options for running the installer with setup.exe /?. From the command line options, you can choose to run the installer silently.

You can use Distributed System Manager to create and configure network variables on the server. Distributed System Manager is installed by default. To run the installer without installing the Distributed System Manager, run the setup.exe /prop SYSMANEXCLUDE=1 command. To run the Shared Variable Engine installer silently and without the Distributed System Manager, run the setup.exe /q /acceptlicenses yes /prop SYSMANEXCLUDE=1 command.

Network Variable Deployment

There is no supported method to automatically deploy network variables with your application; network variables must be manually created on the target machine. You can create the required variables during deployment by using one of the three different methods: implicitly created variables, network variable classes, or Distributed System Manager.

Using Implicitly Created Variables

Implicitly created variables are created when a writer attempts to connect to the variable. Because implicitly created variables need not exist before usage, an application that uses implicitly created variables does not require additional steps to create the variables.

You should use implicitly created variables in the following scenarios:

Refer to the Implicitly Created Variables section in Key Measurement Studio Network Variable .NET Library Features for more information.

Using the Network Variable Class Libraries

You can use ServerProcess, ServerProcessInfo, ServerVariable, and ServerVariableInfo to explicitly create and configure variables on the target machine. If you are performing a server deployment, your application can use these classes to create the network variables as needed, or you can write an application to create the variables as part of the deployment process.

You should use the network variable class libraries to programmatically create network variables in the following scenarios:

Refer to Explicitly Creating Network Variables for more information.

Using Distributed System Manager

You can use the Distributed System Manager application to create and configure network variables on a machine. Distributed System Manager is installed as part of the server deployment scenario described in the Server Deployment section. Select Start»All Programs»National Instruments»Distributed System Manager to launch the application.

You should use Distributed System Manager to manually create network variables in the following scenarios:

For more information about creating and configuring variables with Distributed System Manager, refer to the Creating, Modifying, or Deleting Shared or Network Variables topic in the NI Distributed System Manager Help. In Distributed System Manager, select Help»System Manager Overview to access the help.

Deploying Network Variable Windows Forms Applications

The Deploying Measurement Studio Windows Applications topic contains most of the information required to deploy a Windows Forms application that uses network variables. If you are creating an installer and using the Measurement Studio merge modules to ensure all dependencies are installed, you must include the correct merge modules indicated in the Measurement Studio .NET Merge Modules topic. If the deployment scenario is a server deployment, you must run the Shared Variable Engine installer mentioned in the Server Deployment section.

Deploying Network Variable Web Forms Applications

The Deploying Measurement Studio Web Applications topic includes basic information about deploying Measurement Studio Web Forms applications. However, since the NationalInstruments.NetworkVariable class libraries do not support XCOPY deployment, you must perform some extra steps to ensure your application functions correctly. You may choose to deploy your Web application using XCOPY deployment or the Copy Web Site Tool in Visual Studio, or you may choose to create an installer for your Web application.

XCOPY Deployment or Copy Web Site Deployment

If you choose to deploy your Web application using XCOPY or the Copy Web Site Tool, you must ensure that the correct National Instruments assemblies are either copied to the bin directory for the application or installed in the Global Assembly Cache (GAC) on the target machine. One way to ensure your National Instruments assemblies are in the correct place is to use a custom setup project that uses the Measurement Studio merge modules as discussed in Deploying Measurement Studio Windows Applications. Once the merge modules are added to the project, you can re-target them to an appropriate directory.

Complete the following steps to install a Web application that uses the NationalInstruments.NetworkVariable class libraries to the C:\MyApp directory.

  1. Create a new Setup project.
  2. Configure the default application directory for the project to match the location of the Web application on the target machine. For this example, you perform the following steps to change the default installation directory to C:\MyApp.
  3. Select View»Editor»File System.
  4. Right-click Application Folder and select Properties.
  5. Change the DefaultLocation property to C:\MyApp.
  6. Right-click the Project and select Properties. Change the value of the ProductName property to MyApp.
  7. Add the appropriate merge modules to the project. Refer to Measurement Studio .NET Merge Modules for assistance in selecting the appropriate merge modules.
  8. Each merge module that begins with mstudio has a Module Retargetable Folder property located under the (MergeModuleProperties) header. Change the value of the Module Retargetable Folder property to install the Measurement Studio assemblies to the GAC or the bin folder for the Web application.
    • To install the assemblies to the bin folder, right-click Application Folder in the file system editor and select Add»Folder. Name the new folder bin and update each merge module’s Module Retargetable Folder property to reference this directory.
    • To install the assemblies to the GAC on the target machine, right-click anywhere in the left pane of the file system editor and select Add Special Folder»Global Assembly Cache Folder. Update each merge module’s Module Retargetable Folder property to reference this folder.
    • Right-click your project and select Build to build the setup project.
    • Run the setup project on the target machine. You may need to reboot the target machine to complete the setup.
    • If the deployment is a server deployment, run the Shared Variable Engine installer as described in the Server Deployment section.
    • Configure IIS to recognize the new Web application.

Deployment Using a Setup Project

You may choose to deploy your application in a single setup project rather than using the approach previously outlined. This example assumes you are using a setup project in the same solution as the project that contains the Web application you want to deploy. To use a single setup project, complete the following steps.

  1. Create a new Setup project.
  2. Configure the default application directory for the project to match the location of the Web application on the target machine. For this example, you perform the following steps to change the default installation directory to C:\MyApp.
  3. Select View»Editor»File System.
  4. Right-click Application Folder and select Properties.
  5. Change the DefaultLocation property to C:\MyApp.
  6. Right-click Application Folder in the file system editor and select Add»Output. In the dialog box, select the appropriate Web application project, ensure Content Files is selected, and click OK. When this setup project is built and run, the project should deploy the application’s files and dependencies all at once. Note that in a server deployment scenario, you must still run the Shared Variable Engine installer as described in the Server Deployment section.
Note: Building your network variable setup project results in warnings of the following type: Two or more objects have the same target location 'location' . You can continue to use your setup project normally; these warnings do not affect your project, and you can safely ignore them.

See Also

WAS THIS ARTICLE HELPFUL?

Not Helpful