[vbox-dev] Problem with restoring a snapshot via API: Console is null

Daniel Dreibrodt DDreibrodt at comprion.com
Fri Jul 4 05:51:30 GMT 2014

Hello Klaus,

I've wondered, too. But I just now found the source of the problem. My Visual Studio project was set to build a 32-bit assembly, but I run under a 64-bit Windows with a 64-bit Virtual Box installed. After I changed the project to build a universal "Any CPU" assembly the code worked fine.

Best Regards,

-----Original Message-----
From: Klaus Espenlaub [mailto:klaus.espenlaub at oracle.com]
Sent: Donnerstag, 3. Juli 2014 16:42
To: vbox-dev at virtualbox.org
Subject: Re: [vbox-dev] Problem with restoring a snapshot via API: Console is null


On 02.07.2014 15:52, Daniel Dreibrodt wrote:
> Hello,
> I’m developing a C# application that controls VMs, starts them, stops
> them and runs programs in them. It should also reset the VM to a
> previously saved snapshot.
> But I get a NullReferenceException because the Console object of my
> session is null, although I call LockMachine.
> Here is the code with which I try to reset the machine after it has
> been powered down.

The code looks fine... I wonder if this is some language binding specific problem. Not that it would make much sense, the call isn't doing anything complex like returning a safearray.

Your code is rather close to what VBoxManage does, so I'm puzzled.


vbox-dev mailing list
vbox-dev at virtualbox.org

More information about the vbox-dev mailing list