對.NET使用 TestStand 範例裡的 Building a Sequence Using API 時出現錯誤

更新 Jan 16, 2025

產品資訊

軟體

  • TestStand

程式語言

  • C# .NET

問題敘述

我正試著使用 Building a Sequence Using API 範例來學習如何在 .NET 中建構 sequence file。但當我在 Visual Studio 中運行該範例時,卻出現以下錯誤。我該如何解決這個錯誤?

A project with an Output Type of Class Library cannot be started
directly.

In order to debug this project, add an executable project to this
solution which references the library project. Set the executable
project as the startup project.
 

2023-05-19_09h59_55.png

解決方案

您應該將SequenceFileXMLParser的build Solution構建在C:\Users\Public\Documents\National Instruments\ <TestStand Version> \Examples\TestStand API\Building a Sequence Using API\DotNet\SequenceFileXMLParser以產生動態連結程式庫 (DLL)。
2023-05-19_10h30_12.png
預設情況下,生成的 DLL 會位於 C:\Users\Public\Documents\National Instruments\ <TestStand Version> \Examples\TestStand API\Building a Sequence Using API\DotNet\SequenceFileXMLParser\SequenceFileXMLParser\bin

相關資訊

這是預期的行為。要使用此範例,您應該是建構一個解決方案而不是去啟動它。這是由於該項目的目的是建構一個 DLL 並在sequence file中被調用。