Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vector CANoe-如何使用多个C#文件构建.NET测试节点?_C#_.net_Testing_Canoe - Fatal编程技术网

Vector CANoe-如何使用多个C#文件构建.NET测试节点?

Vector CANoe-如何使用多个C#文件构建.NET测试节点?,c#,.net,testing,canoe,C#,.net,Testing,Canoe,目标 我想使用Vector CANoe C#(.NET)脚本功能。 更具体地说,我想通过构建一些核心实用程序类来降低.NET测试节点的复杂性 比如说,我们没有这个 // With the Vector API directly IVT2516Channel M4_Ch9 = vts.GetChannel("M4_Ch9"); M4_Ch9.DigitalOutput.Value = true; 对象可以执行以下操作: // With an Object that abstr

目标
我想使用Vector CANoe C#(.NET)脚本功能。
更具体地说,我想通过构建一些核心实用程序类来降低.NET测试节点的复杂性

比如说,我们没有这个

// With the Vector API directly
IVT2516Channel M4_Ch9 = vts.GetChannel("M4_Ch9");
M4_Ch9.DigitalOutput.Value = true;
对象可以执行以下操作:

// With an Object that abstract the Vector API
MyECU ecu = utilities.MyECU();
ecu.OpenContactor(True);
为了实现这一点,我的计划是构建每个.NET测试模块都会使用的
utilities.cs
文件 这个想法大致是这样的:

+---------------------------+
| CANoe Test environment    |
|                           |
|   +--------+ +--------+   |
|   |  .NET  | |  .NET  |   |
|   |  test  | |  test  |   |
|   | module | | module |   |
|   +--------+ +--------+   |
|        |         |        |
+--------|---------|--------+
         |         |
+--------v---------v--------+
|                           |
|    CORE UTILITIES (C#)    |
|                           |
+---------------------------+
             |
+------------v--------------+
|                           |
|       VECTOR Modules      |
|                           |
+---------------------------+

问题
我不能让编译器高兴。 我总是收到错误CS0246。 在独木舟控制台中:

System  Testmodule 'Test 1': Compilation of tests_wakeup.cs' failed with error(s)
System  tests_wakeup.cs(17,7): error CS0246: The type or namespace name 'utilities' could not be found (are you missing a using directive or an assembly reference?)
使用VisualStudio时,我的解决方案不会出现问题

问题

如何使用多个C#文件构建.NET测试节点?

我认为您在CANoe测试配置中选择了文件
utilities.cs

使用该设置,CANoe将只编译一个文件,即使您可以在VisualStudio中编译整个项目

但是,CANoe不仅支持
.cs
文件,而且还支持
.dll
.sln
文件

知道了这一点,您可以简单地更改配置以使用VisualStudio项目的解决方案文件或输出DLL文件


注意:我也有同样的问题,我在寻找解决方案时发现了这篇文章。
您将什么配置为testmodule?(c sharp)源文件还是程序集?@M.Spiller我对c#汇编过程不是很熟悉,所以A尝试了我能想到的一切:作为c#项目,.cs源文件和.dll文件。它们都会产生相同的错误,并且都是在VisualStudio中无错误地构建的。这解决了我的问题。出于文档目的:在“独木舟测试设置”窗口中,可以添加
.NET测试模块
。如@dan1st所述,此测试模块可以添加visual studio
.sln
文件。这将迫使CANoe编译您的多文件解决方案。再次感谢先生/女士。正如我所说,我有同样的问题:)