使用XBOX控制器连接乐高NXT到MRDS时,创建xinputgamepad服务错误



我正在尝试使用xbox控制器(Microsoft Robotics Studio和Lego Mindstorms NXT)将我的Lego NXT连接到MRDS的简单机器人示例

一切正常,但当我去运行服务时,我得到以下错误:

*** Error creating service. Service type:http://schemas.microsoft.com/robotics/2006/09/xinputgamepad.user.html

这是构建的输出:

Not processing file:c:usersmatthewmicrosoft robotics dev studio 4    betabinxinputgamepad.y2006.m09.dll
*   Contract directory cache refresh complete [10/25/2011 21:22:18][]
*** Could not load implementation assembly for: http://schemas.microsoft.com/robotics/2006/09/xinputgamepad.user.html [10/25/2011 21:22:18][]
*** Exception during service type creation: System.IO.FileNotFoundException: Could not load implementation assembly for: http://schemas.microsoft.com/robotics/2006/09/xinputgamepad.user.html
at Microsoft.Dss.Services.Constructor.ConstructService.Process() [10/25/2011 21:22:18][]
*** "TaskExecutionWorker:HandleException": Exception:System.IO.FileNotFoundException: Could not load implementation assembly for:      http://schemas.microsoft.com/robotics/2006/09/xinputgamepad.user.html
   at Microsoft.Dss.Services.Constructor.ConstructService.Process()
   at Microsoft.Dss.Services.Constructor.InternalConstructor.CreateNewServiceHandler(ConstructService Create)
at Microsoft.Ccr.Core.Task`1.Execute()
at Microsoft.Ccr.Core.TaskExecutionWorker.ExecuteTaskHelper(ITask currentTask)
at Microsoft.Ccr.Core.TaskExecutionWorker.ExecuteTask(ITask& currentTask, DispatcherQueue p, Boolean bypassExecute)
at Microsoft.Ccr.Core.TaskExecutionWorker.ExecutionLoop()
*** Error creating service. Service type:http://schemas.microsoft.com/robotics/2006/09/xinputgamepad.user.html [10/25/2011 21:22:18][http://buzzman-pc.mex.com.au:40000/constructor]

我正在运行微软机器人工作室Beta 4,我知道样本是在2007年放在一起的,所以它可能是一个混乱的。这是我的合伙人代码:

[Partner("drive", Contract=drive.Contract.Identifier, CreationPolicy=PartnerCreationPolicy.UseExisting)]
    private drive.DriveOperations _drivePort = new drive.DriveOperations();
    [Partner("XInputGamepad", Contract = gamepad.Contract.Identifier, CreationPolicy = PartnerCreationPolicy.CreateAlways)]
    private gamepad.XInputGamepadOperations _gamepadPort = new gamepad.XInputGamepadOperations();

我可以看到问题似乎是它正在寻找xinputgamepad.user,但MRDS 4中的参考是user.xinputgamepad。

任何想法?

我怀疑你没有安装合适的XNA版本,因为XInput合同中的2006年。

在Robotics Studio的最新版本中应该有非常相似的代码。看看这里:http://msdn.microsoft.com/en-us/robotics/aa731520

最新更新