Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Debugging a Visual Studio .NET Assembly from TestStand

Primary Software: TestStand
Primary Software Version: 3.0
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
The TestStand Help states that it is possible to debug a Visual Studio .NET assembly from TestStand. I have created a .NET assembly (.dll) but I can't figure out how to debug it. How can I debug this assembly from TestStand?

Solution:
For a better method to debug .NET assemblies and C++ DLLs from TestStand, please refer to KnowledgeBase 3JSBDH1J: How to Step Into a Visual Studio .NET Assembly or C++ DLL from TestStand.

To step into an assembly from TestStand, you can step directly into the source code for the code module following the steps outlined in the KnowledgeBase above, or you can launch the TestStand Sequence Editor from Visual Studio as an external debugging process. To do this, follow the instructions below:

Visual Studio 2005

  1. Launch Visual Studio and load the solution that contains the source code and compiler instructions for your assembly.
  2. In the Solution Explorer, select your project (not the solution).
  3. Select Project » Properties from the menu bar.
  4. Click the Debug tab. If programming in C++, jump to steps 4 - 6 of the Visual Studio 2003 section.
  5. Choose the Start external program option.
  6. Click on the ellipsis button to navigate to the <TestStand>\Bin directory and then select the SeqEdit.exe program.

Visual Studio .NET 2003

  1. Launch Visual Studio and load the solution that contains the source code and compiler instructions for your assembly.
  2. In the Solution Explorer, select your project (not the solution) .
  3. On the Project » Properties from the menu bar.
  4. Select the Configuration Properties folder and then select the Debugging category.
  5. Choose the Command (in C/C++), Start Application (C#), or Start External Program (Visual Basic) option.
  6. Navigate to the <TestStand>\Bin directory and then select the SeqEdit.exe program.

Note: Instructions for Visual Studio .NET 2003 are only valid for versions of TestStand prior to 4.0. In order to debug using a later version of TestStand, you must upgrade your version of Visual Studio.

To start debugging, click the green run arrow in the toolbar (or select Build » Debug from the menu, or click F5). This will bring up an error message stating that the SeqEdit.exe does not have debugging information. This is shown in the attached snapshot "VS Error.jpg" (Visual Studio 2005 message is the top dialog and Visual Studio 2003 is the bottom dialog). When this message appears, click Yes (in Visual Studio 2005) or OK (in Visual Studio 2003) to accept the settings.

The TestStand Sequence Editor will then open. From the sequence editor, you can now step through the sequence you have created, and step into your assembly. Once inside your assembly, you can then use the debugging features of Visual Studio. Refer to Chapter 5, Module Adapters, of the NI TestStand Reference Manual for more information about using the .NET Adapter with Visual Studio.



Related Links:
KnowledgeBase 3JSBDH1J: How to Step Into a .NET Assembly and Launch Visual Studio .NET from TestStand

Attachments:



VS Error.jpg


Report Date: 09/27/2006
Last Updated: 02/19/2009
Document ID: 41QA7PT3

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