This project has moved. For the latest updates, please go here.

System.ArgumentNullException when executing batch commands

Jan 30, 2014 at 7:50 PM
I am receiving a System.ArgumentNullException when I call the SendCommandAsync() method. I am assuming that this has something to do with my code not adding the batch commands like I am trying to, since I am adding them using external classes that I have created by passing the brick as a parameter. Something that I would like to be able to do is check the BatchCommand property to see what and how many commands, if any, are getting added, and so that I can check that before trying to call SendCommandAsync(). Is there a way to check this? Thanks.
Coordinator
Jan 30, 2014 at 8:44 PM
Commands and parameters are directly encoded into their bytecode equivalents when the API method is called. Unfortunately, there's no record of the list of commands or anything like that. You could inspect the MemoryStream in the Command object to see what bytes are in place.

The other item to keep in mind is if you're using the WinRT lib, there was a bug which causes a null ref exception to occur at times. It's fixed in the latest source code but new binaries have not yet been produced. You may want to grab the latest source and compile directly to make sure you're not running into that issue.
Jan 31, 2014 at 2:02 AM
I am using the WinRT lib, so where can I download the source code? When I installed the package I am currently using, I installed it using NuGet, and I seem to be having trouble downloading the source code from the legoev3.codeplex.com site. Can you give me more details on how to download the source code? Thanks.
Jan 31, 2014 at 5:09 AM
Hi,

peekb told me to download the source code from here:

https://legoev3.codeplex.com/releases/view/114257

Find link: Library + Docs
You will probably need Visual Studio 2013 for Desktop.

It will have source code for WinRT, Windows Phone and Windows 7
I am using the Windows 7 ( WPF project code )

Thanks, Paul
Jan 31, 2014 at 3:10 PM
Thank you. I'm not sure why it didn't let me download it before, maybe the site was just in a bad mood, but it downloaded great this time. I have and am using Visual Studio 2013 Professional on Windows 8 Pro (in desktop mode, of course, even though I'm developing apps). I'll let you know if I still get the System.ArgumentNullException with this source code.
Coordinator
Jan 31, 2014 at 3:12 PM
For the latest full source code, you want to click on the Source Code tab above, then click the Download button over on the right side. That should give you a .zip file of the entire source tree.

I'll get around to putting up new binary packages at some point...