【发布时间】:2010-10-26 18:52:35
【问题描述】:
尝试使用有关该主题的唯一且唯一的文档来自动化 WHQL 测试:http://www.microsoft.com/whdc/devtools/wdk/dtm/dtm_dsso.mspx
我已经使用了示例代码,并且能够连接、列出设备等。从那里我创建了一个新项目,一个 .NET 2.0 C# 类:
using System;
using System.Reflection;
using System.IO;
using CookComputing.XmlRpc;
using Microsoft.DistributedAutomation.DeviceSelection;
using log4net;
class WhqlXmlRpcService : XmlRpcService
{
private static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public static DeviceScript deviceScript;
[XmlRpcMethod("connect")]
public Boolean Connect(String dtm)
{
Boolean retVal = false;
deviceScript = new DeviceScript();
try
{
deviceScript.ConnectToNamedDataStore(dtm);
retVal = true;
}
catch (Exception e)
{
Log.Debug("Error: " + e.Message);
}
return retVal;
}
}
我正在使用 XML-RPC.NET 创建由 IIS 托管的服务器(使用 ASP.NET 2.0)。 DTM Studio 安装在 C:\Inetpub\wwwroot\xmlrpc\bin 中,与我的班级目标所在的位置相同,以确保我引用的十几个 .dll 没有分辨率问题(按照 DSSO 的指示文档)。我尝试将必要的 DSSO 库添加到 GAC 以避免这种情况,但并非所有这些库都具有强名称。因此,尽管能够看到它需要链接的所有库(并且 Studio 应用程序功能很好地安装在非标准位置),但尝试 .ConnectToNamedDatastore("nameofDTM") 仍然会导致以下结果:
xmlrpclib.Fault: <Fault 0: 'Could not connect to the controller to retrieve information. Several issues can cause this error including missing or corrupt files from the installation, running the studio application from a folder other than the install folder, and running an application that accesses the scripting APIs from a folder other than the installation folder.'>
我正在从安装文件夹访问脚本 API,因为它与我的 Web 服务 .dll 的目录相同,并且文件没有损坏,因为如果我将带有 DSSO 示例代码的 .exe 粘贴在同一目录中目录我可以看到它在调试器中连接得很好。
我对此束手无策,无法在任何地方找到有用的 DTM/DSSO 信息来源。
任何人过去做过类似的事情,或者在自动化他们的 WHQL 测试方面取得了任何成功?
【问题讨论】: