Windows 8 and 8.1 Forums


Windows Phone Default Emulator not working

  1. #1


    Posts : 3
    Windows 8.1

    Windows Phone Default Emulator not working


    Laptop Model: Dell core i3
    Processor : 2.4 GHz
    RAM: 4 GB
    I am trying to run my windows phone 8 app developed in visual studio 2013 on emulator but when I run the project, emulator starts loading but deployment fails and i get an error in a dialog box saying "invalid query" then in the output pane the error is displayed saying "A method was called on an uninitialized object" or "invalid pointer". Can anyone help me solve this issue?

      My System SpecsSystem Spec

  2. #2


    A Finnish ex-pat in Leipzig, Germany
    Posts : 1,452
    Windows 8.1 Pro with Media Center


    Although not sounding logical, those error messages can point to issues with your virtual switches, emulator not being able to connect to the network.

    Two things to check first:
    1. The virtual switch used by emulator should not be using a host NIC with a static IP. Check that your NICs are using DHCP to get a dynamic IP
    2. WP8 Emulator needs a dedicated connection. If your host PC has both WiFi and LAN connections, be sure both are connected to network (router) and a virtual switch exists for both. WP8 emulator can't connect if the host it's running on only has one NIC connected to the network

    One way to test if this is in fact a connection issue is to use your WP8 device for debugging and testing instead of the emulator. Connect your phone to PC with USB cable, unlock the phone, open the emulator / device list by clicking the arrowhead symbol and select device:

    Click image for larger version

    Now debug, see if the app runs normally on your phone.

    If yes, I would recommend the following procedure:
    • Delete all WP emulator virtual machines from Hyper-V
    • Delete all Hyper-V virtual switches
    • Connect both WiFi and LAN, check both connections OK
    • Reboot
    • Launch Visual Studio
    • Select an emulator from the list (this time not the device)
    • Debug. This makes Visual Studio to re-create all necessary virtual switches. Emulator should work now
    • If you have other virtual machines on Hyper-V than WP emulators, they are still set to use your old virtual switches. Please change them to use your new switches in setting for respective vm

    Result should be a working WP8 emulator:

    Click image for larger version

    Kari
    Last edited by Kari; 18 Apr 2014 at 04:09. Reason: My eternal problem, a lot of typos :)
      My System SpecsSystem Spec

  3. #3


    Posts : 3
    Windows 8.1


    I don't know how to check the first two things you mentioned.
    App runs normally on phone.
    I followed the last 8 instructions but emulator is not working.
      My System SpecsSystem Spec

  4. #4


    A Finnish ex-pat in Leipzig, Germany
    Posts : 1,452
    Windows 8.1 Pro with Media Center


    Quote Originally Posted by Zeba Hassan View Post
    I don't know how to check the first two things you mentioned.
    App runs normally on phone.
    I followed the last 8 instructions but emulator is not working.
    Please do not take this personally but if you do not know how to check the first two things I asked you to check, it's difficult to understand how you could manage the latter 8 step instructions?

    Let's try again:

    First, if Hyper-V is correctly set up, you will have a virtual switch (= a virtual network adapter) for both of your laptop's network adapters, for the LAN (Ethernet) and WLAN (WiFi) adapters. To check this, open Hyper-V Manager, click Virtual Switch Manager in Actions pane. You should now see a virtual switch for LAN adapter (in my case Realtek) and for WLAN adapter (Broadcom in my case):

    Click image for larger version

    (Click a screenshot to enlarge.)

    For Hyper-V Windows Phone Emulator virtual machines to work and connect correctly, your host system (Windows 8) has to be connected to network with both the LAN and WLAN virtual switches. Open Network and Sharing Center, you should see that you are in fact connected with both LAN and WLAN virtual switches:

    Click image for larger version

    In a correctly set up system, you will see both are connected. If not, connect both now. Next you need to check they are both using DHCP to get an IP address, a so called dynamic IP instead of static IP. Do this for both connections, one at the time: Click a connection in Network and Sharing Center, click Properties, select Internet Protocol Version 4 (TCP/IPv4), click Properties, select Obtain an IP address automatically, Click OK to save settings:

    Click image for larger version

    Now let's check your emulator images are working independently, outside Visual Studio environment. First open settings to each emulator vm to check that each emulator vm has at least following three virtual switches:
    1. Windows Phone Internal switch
    2. Windows Phone External switch for your LAN adapter
    3. Windows Phone External switch for your WLAN adapter


    Click image for larger version

    Now run any emulator vm directly from Hyper-V Manager:

    Click image for larger version

    If it works but still is not working when debugging an app from Visual Studio, then at least we know the reason is not in Hyper-V setup or settings. In that case, please make screenshots of any error messages and post here.

    Kari
    Last edited by Kari; 26 Apr 2014 at 21:18. Reason: Fixed some typos
      My System SpecsSystem Spec

  5. #5


    Posts : 3
    Windows 8.1


    I have checked all the steps you told but I have no Virtual Machine listed inside my Hyper V manager.Click image for larger version
      My System SpecsSystem Spec

  6. #6


    A Finnish ex-pat in Leipzig, Germany
    Posts : 1,452
    Windows 8.1 Pro with Media Center


    That is normal.

    Each WP virtual machine is first created in Hyper-V when you launch your app for debugging from Visual Studio in an emulator. That means that to get all possible WP virtual machine images installed on Hyper-V, you have to select all available emulators one by one in Visual Studio, then debug using that emulator. Only at this stage is then the virtual machine for this emulator created in Hyper-V.

    An example: Hyper-V installed and enabled, Visual Studio installed and launched first time. Selecting Emulator 8.0 10322 WXGA as in the screenshot below, then debugging your code using this emulator first time will create the Hyper-V virtual machine for this emulator:

    Click image for larger version

    Doing this for each emulator you will create the Hyper-V virtual machines:

    Click image for larger version

    Do not rename these emulator virtual machines! For instance I do not love my own name so much I would like to have it included in every emulator vm name, but that's how Visual Studio does it, adding your Windows username to each emulator name.

    Kari
    Last edited by Kari; 11 May 2014 at 19:06. Reason: Fixed some typos
      My System SpecsSystem Spec

Windows Phone Default Emulator not working
Related Threads
How to Lock Your Windows Phone 8 and Show Message Online Find My Phone is a free service for your Windows Phone 8 at the My Phone section on WindowsPhone.com that can ring, lock, erase, or show your phone on a map from any Internet-connected computer. Find My Phone makes it easier to recover...
My brother essentially wants one for his new RT 8.1 tablet. I have an Android version as I didn't go with a Surface device and he's got little access to the internet whereas I can, if possible, use my laptop and download an app from the Windows Store- I would just need to know how to save an...
Hello 8Forums Community, I'm having file association issues. I've have tried troubleshooting this for hours without any avail. I'm coming here as a last resort....now that I think of it, maybe I should have come here first. On to my issue: I recently lost file association capabilities...
if install win 8.0 pro in VM like Parallels or VmWare in PC win 7 or a Mac,... win 8.0 phone emulator should work? yes, emulators work in VM No neither PC nor Mac, only Phone App build should work. Neither build nor emulator work
How to Reset your Windows Phone 8 to Default Factory Settings Resetting your phone will return it to the same state it was in the first time you turned it on. All your personal content, including media, text messages, call history, and apps you've downloaded (along with app data and game...
How to Erase and Reset Your Windows Phone 8 Remotely Online Find My Phone is a free service for your Windows Phone 8 at the My Phone section on WindowsPhone.com that can ring, lock, erase, or show your phone on a map from any Internet-connected computer. Find My Phone makes it easier to...
Solved Phone driver not working in Drivers & Hardware
I tried to plug in my G2x into my laptop that has Win8. Usually what happens on my PC with Win7 is that it opens Windows explorer so I can open up files on my phone. The laptop isn't doing that. When I first plugged in my phone to the PC it installed a program to install the proper driver for the...
Eight Forums Android App Eight Forums IOS App Follow us on Facebook