Friday, November 30, 2012

Windows Phone 8 Emulator issues in Visual Studio 2012

I haven't had much luck to date getting up and running with the WP8 SDK for Visual Studio 2012. When I attempt to start the emulator I get the message:

The connection to the virtual machine has been lost. The virtual machine may have been turned off by another application. The Windows Phone Emulator must close.

After this has occurred, attempts to restart the emulator produce the following error:

The Windows Phone Emulator wasn't able to set some properties on the virtual machine:

Couldn't change Memory of the virtual machine: Error code 32775

I have a 64-bit Intel i7 processor with virtualization enabled in the bios. Hyper-V is installed. I have more than enough memory (32 GB).


Solution

I found my specific issue. The VPN software that I had installed was preventing the local VM connection, even when it wasn't actively running. Uninstalling it resolved the issue.

The response from the VPN provider indicated the issue was with the Layered Service Providers:

It seems the problem is with incompatibility of LSPs (Layered Service Providers) - [VPN Name] uses a LSP to redirect traffic as well as Hyper-V software.

See Also:

Salesforce convert Apex integer to long

A quick snippet after I came across the following when modifying some apex:

integer someId = 12345;
aMethodThatTakesALong(Long.valueOf(someId.format()));

Note the transition via an intermediate string to get to the long required by the method.

Usually Apex will implicitly convert an integer to a long if required. E.g.

Integer testInt = 12345;
Long testLong = testInt;
System.assertEquals(12345L, testLong);

In the case of the method parameter above you can either rely on the implicit casting or, where there may be other overrides available, explicitly cast the integer to a long. E.g.

integer someId = 12345;
aMethodThatTakesALong((long)someId);