5

Background

A few years ago I was developing for C#, WPF and Silverlight and then moved to developing for Android.

I've decided to give Windows phone a try, and install the newest Visual Studio Pro 2012 with its Windows phone sdk, together with the latest version of Windows - windows 8 pro.

I've created a new Windows phone project hoping I will start learning from a hello world project, and I've launched the emulator .

Some specs information

  • OS is windows 8 pro (final) . 64 bit CPU .
  • Visual Studio Pro 2012
  • Windows phone sdk 8
  • Connected by usb to a wireless D-Link device (DWA-140) .

The problem

Just as soon as I've started the emulator, a dialog came asking if I want to enable networking:

enter image description here

When I chose that I want, an error has appeared:

enter image description here

After selecting ok, the emulator crashed.

Knowing how to search for solutions on the internet, I've found a few (like here and here ) that suggested me to delete the network switches, create an internal switch, and whatnot.

The question

I don't understand what I'm doing wrong, and this is just my starting point. Can anyone please help me with this error and how to make the emulator work?

Please tell me the exact steps that I need to take.


EDIT: after uninstallation of anything related to VS and WP , i've re-installed them both and i still get the same errors.

Not only that , but when trying to create a new external switch (which some websites offered) , it showed me the next error :

enter image description here

How could such a basic feature of an emulator be missing out of the box ?

Community
  • 1
  • 1
android developer
  • 106,412
  • 122
  • 641
  • 1,128
  • Did you get this resolved? – BStateham Jan 15 '13 at 16:51
  • no , why ? do you have the same problem ? – android developer Jan 15 '13 at 18:39
  • No, let me look into it and see if I can offer any help. Can you give me the specifics on your system (os, machine, etc) – BStateham Jan 16 '13 at 01:14
  • OS is windows 8 pro (final) . 64 bit CPU . what else do you want to know ? – android developer Jan 16 '13 at 07:00
  • Does your machine have a static IP address by any chance? – allen Feb 14 '13 at 18:41
  • I believe it doesn't , since it uses the usb device i've written about , which connects to the router and asks it for a new IP each time it's connected , right? Anyway , why would such a thing matter for an emulator that can simply use the current internet connection like any other app does (and even a web browser) ? I can't believe that I need to mess with network configurations just to have a connection running on an emulator. – android developer Feb 14 '13 at 21:11
  • Just because it is connecting to a router does not mean it would get a new IP. The phone 8 emulator is equivalent to a VM on your host and will show up as a device on your network hence requiring its own IP. You should manually try to create a VM with the appropriate networking to see if there is a hyperv issue that you are running into.\ – allen Feb 15 '13 at 02:09
  • But the router is giving the computer a new IP each time , since it's in a LAN network , no ? I didn't change the settings of the router to give my computer a static IP . Anyway , how should i configure the hyperV to make the emulator finally be able to use my internet connection ? – android developer Feb 15 '13 at 08:05
  • just head to the hyper-v manager and create a virtual network to see if that is being created fine independently using virtual switch manager. Then possibly create a vm too and see if that works. Basically eliminate core hyper-v issues before moving on. – allen Feb 15 '13 at 08:13
  • I've tried running it as admin , and then I've tried adding a new virtual switch with the default configurations that it has, yet it still has an error. It shows me : "Error applying virtual switch properties changes" - "Adding ports to the 'new virtual switch' failed " . What should I do now ? – android developer Feb 15 '13 at 08:41

2 Answers2

2

You might try a couple of things.

First, verify the network connection settings for the "vEthernet (Internal Ethernet Port Windows Phone Emulator Internal Switch)" adapter.

To do so, open "Control Panel\Network and Internet\Network Connections" in Control Panel. Right click on the "vEthernet (Internal Ethernet Port Windows Phone Emulator Internal Switch)" adapter, and choose "Properties". Under "This connection uses the following items:" verify that ONLY the following options are selected:

  • Client for Microsoft Networks
  • QoS Packet Scheduler
  • File and Printer Sharing for Microsoft Networks
  • Microsoft LLDP Protocol Driver
  • Link-Layer Topology Discovery Mapper I/O Driver
  • Link-Layer Topology Discovery Responder
  • Internet Protocol Version 6 (TCP/IPv6)
  • Internet Protocol Version 4 (TCP/IPv4)

enter image description here

In addition, you may want to review the network adapter settings for the emulator image in "Hyper-V Manager"

Verify the network adapters that are shown are valid. You might try disabling some (like the adapters connected to the WiFi or Wired Ethernet adapters on your machine) if the adapters they are bound to are not currently enabled in the OS.

enter image description here

Let me know if that helps!

BStateham
  • 1,561
  • 9
  • 15
2

I suspect you may be running afoul of UAC. As you've noted, it's trying to create a virtual device. Doing so requires elevated permissions. If I were you I would either run VS2012 as Administrator or completely disable UAC until it's all installed and configured, and then you can turn UAC back on if you prefer it on. I think Allen's comment about manually creating a VM with the appropriate networking is astute and a worthwhile experiment, since it sidesteps the possible UAC issues.

Peter Wone
  • 15,594
  • 12
  • 74
  • 106
  • Actually , I really hate UAC and that's one of the first things I've done when installing windows . What should I do when I open VS with admin rights? – android developer Feb 15 '13 at 08:08
  • If UAC were active you would right-click the Visual Studio icon and in the context menu you would click *Run As Administrator* but if you have UAC deactivated this [a] probably won't be available in the context menu and [b] probably won't help even if you can find it. – Peter Wone Feb 15 '13 at 12:33
  • If you were asking what you should do *after* launching VS (or whatever software you're trying to use to create a VM) with admin rights, you should simply have another go at setting up the VM. – Peter Wone Feb 15 '13 at 12:39
  • I've tried running VS with admin rights , but the emulator still doesn't work when I use internet connection and it just crashes . How could it be ? – android developer Feb 15 '13 at 13:11