Problems with Windows Phone 8.1 emulator - visual-studio

I am having really difficult time to cope up with the windows phone emulator.
My ultimate goal is to deploy my application and sniff http requests through fiddler.
I am on Visual Studio 2013 Update 4 on Windows 8.1
Problems which i face
Sometimes the emulator does not start at all and gets stuck "Window Phone OS is starting ".
Here first i get the message of "Attempting to modify switch settings" info dialog. I clicked on ok. Then i get Error dialog of "Windows Phone emulator is unable to connect to the windows phone operating system" "Object reference not set to an instance of an object "(Internal c# error). I click close and it gets stuck at "Windows Phone OS is starting".
if i get past this problem and my application gets deployed. I cannot connect to internet. Even a link in browser does not open.
Now for the rarest of rare times i am able to connect to internet. I am in no way able to sniff http request.
But sniffing is still my secondary problem, but my first issue is to get the emulator run and connect to internet.
Steps which i have performed to troubleshoot.
Hyper-V as a Windows feature is turned on.
My firewalls have been disabled.
I have removed the virtual machines and switch created by Hyper-V manager and let it be created through Visual Studio.
In network connections, disabled and enabled the vEthernet (Windows Phone emulator switch ).
Have also tried ipconfig/renew.
Have gone through lot of msdn posts, blogs, so questions but the behaviour of emulator is pretty inconsistent.
Is there any way i can get emulator logs/info ?
Any help to direct to me to any direction will be hugely appreciated.
UPDATE
only thing which is consistently working for me right now is disabling Hyper-V windows feature and then enabling it again.
Mind the expensive system restarts also. Then adding my user name to Hyper V admin group and then deploying the application.
So whenever i am changing my network i have to perform these steps. Definitely not sustainable
UPDATE 1
So now i have fiddler also acting as a man in the middle. Followed the steps here http://blogs.msdn.com/b/wsdevsol/archive/2013/06/05/configure-the-windows-phone-8-emulator-to-work-with-fiddler.aspx. Couple of thing to change here are the port number and to give the ip number instead of host name.
Also have fiddler always start first and then the emulator. Fiddler is able to sniff the requests happening in emulator. But my application http requests are not going through which is fine if i run without fiddler. I am currently looking into this.
Best Regards,
Saurav

Have you tried to run Visual Studio as Administrator? Sometimes, the user must have highest privileges to run Hyper-V.

Related

The server is stopped

I downloaded the latest version of Appium from the GitHub. I have installed it on two Windows PCs,
On first one it works fine.
But on the second one, just by clicking "Start server v1.7.2" a window appear showing "The server is stopped".
What is wrong with the configuration?
I found the solution for above error.
It was due to firewall modified by an antivirus, it disables all open ports on this PC.
There can be around three solutions:
Format the PC will help us to get open ports, but it is not a recommended solution.
Uninstalling Antivirus can open blocked ports, by recovering firewall to its original state.
If the 2nd solution does not help then Uninstalling Antivirus and create a new User Account on PC, helps me to run Server successfully.

DEP0001 : Unexpected Error: -1988945906 while deploying Windows UWP app to phone

Exact error:
Severity Code Description Project File Line Suppression State
Error DEP0001 : Unexpected Error: -1988945906 TestApp
What does it mean? It seems it isn't problem with application, it works OK on PC.
Version of OS: 1511, Windows 10 for phones 10.0.10586.164
I've experienced the same problem after updating Visual Studio community to Update 2. Typing in CMD (under admin rights) the following command solved my issue:
net start IpOverUsbSvc
Thanks to Agrgg for a good tip ;)
This kind of error happens very randomly and usually it means there was an issue during the deployment of the app. Things to check:
Developer mode is correctly enabled on phone
Uninstall the app from phone, rebuild solution and then try debug again
Check that the architecture for all projects is set accordingly (ARM for debugging on real device)
Sometimes the VS debugger hangs up, so closing VS and kill from Task Manager all VS processes that are eventually running and restart VS may also help.
I had the same error with deploying onto Windows Phone 8.1 device. In my case the problem was in Windows Phone IP over USB Transport (IpOverUsbSvc) service, which wasn't running. The deployment error disappeared after I'd started the service manually.
I had the same problem.
"net start IpOverUsbSvc" didn't worked for me (throws Access is denied Exception).
I have followed following steps to fix.
Start Run (Windows+R), Type: services.msc
Start/Restart Windows phone IP over USB Transport.
For the RPi, I have RPi3 with WIOT (build 14376) this error happens after failed deployment. Just restart VS and it'll deploy ok.
After trying some of the answers already provided and nothing worked, I fixed the error by simply restarting the phone.
After that the error was gone for me.
I had the same issue, and found that in my case it was occurring while the phone was downloading system updates in the background.
App updates/installations from the app Store were also prevented from downloading/installing.
After the update had finished, all was back to working again.
As Windows Phone 10 doesn't seem to make it obvious that it's downloading updates, maybe worth checking this out if you hit this problem.
I had the same error, solution is here: https://msdn.microsoft.com/ru-ru/library/windows/apps/jj863509(v=vs.105).aspx
Look at Checking BIOS settings required by Hyper-V for Data Execution Prevention. You must select "Turn on DEP for all programs and services except those i select" and in my case application deploys successfully.
For me, it was as simple as unlocking the phone so that the computer would have access to it.
I had this issue as well. None of the answers helped me. IpOverUsbSvc was up and runing, phone reset, system reboot, nothing...
The issue was fixed after a Visual Studio "repair": control panel -> Programs and features -> select VS2015 -> Repair
I got a similar error.
The reason the error occurred for me was because I forgot to add the new splash images in assets after deleting the old ones.
The solution was to add the images. To get the correct image names and sizes, I used this extension for visual studio.
For Windows 10 (desktop) users
I faced this problem after I uninstalled Windows 10 SDK. It deleted the IpOverUsbSvc service from the system.
Solution
Download the Windows 10 SDK .iso installer
Inside it there is Installers folder.
Find Windows IP Over USB-x86_en-us.msi. Install it. (Don't worry if there is no setup window, it installs fast and silently).
I didn't even have to reboot VS2015, it just worked.
Check if the IpOverUsbSvc service is running
Open a Powershell prompt and type Get-Service -Name *USB*
Or go to the Services window. There you should see the IpOverUsbSvc running.
So, I think I get the trick. After plugged in your Windows Mobile device, Windows App Deploy can see W10M device, but once your device goes to lock screen, WPD can not detect it anymore.
You should to plug out and plugin again, with screen unlocked, to make it detectable. (I'm not a really English speaker).

Getting Visual Studio debugging to work when running in Parallels

I've got a Windows 7 machine set up on Paralells.
Everything is working fine. Can access internet from IE or other browsers on my Parallels.
However, when trying to debug a web application in Visual Studio 2010 (by pressing F5 for example) then my default browser in OSX launches, which is great, with localhost:4243 (or whatever port Cassini has allocated on my vm)
Naturally, this doesn't find anything...
What do I need to do to either my parallels vm, or the settings on OSX to get debugging working? ie- my mac talking to the vm?
Make sure you are on the same network.
Use IIS.
Like so:
Your Win-machine has a name, let's say it's called "myWin7machine". Change "localhost:4243" to "myWin7machine:4243" in the browser.
If this doesn't work (well... it shouldn't) you might have the firewall on or the network not bridged. Let's start with the bridging.
Time to check some basics - be on the same network
Check your IP address. It's "ipconfig" on the Win machine and "ifconfig" on the mac; both run from the command prompt. The IP address should be something like 10.4.... or 192.168... on both. The important thing is that only the last number is different. (this is technically not correct but works for 99% of the cases) If they are equal (except the last) you are bridged - which means both machines are on the same network. If they differ too much you had running the Win machine's network "inside" the Mac's. Go to the settings for Parallels (in windows: move your mouse to the top to show Parallel's menu and go to Devices->Network and something "(bridged)". Wait until the balloons disappear and check ipconfig again.
Check that you can ping the Win machine from the Mac. Ping functionality might be turned off in the Win machine but probably isn't.
Now we know we are on the same network.
Still doesn't work
Can you do http://myWin7machine:4243 from the mac? Well.. you shouldn't be able to.
Can you do it from the Win machine? You should.
IIRC Cassini doesn't talk to strangers. I.e. it doesn't talk to anything but localhost.
If I am wrong - just open port 4243 in the firewall on the win machine and you should be good to go.
But otherwise...
Time to change web server.
Install IIS on the win machine.
In the Mac: surf to http://myWin7machine and see the IIS7 logo show.
If you don't you have a firewall issue. Open port 80. Try again.
If you have come this far then you can surf from the Mac to the IIS on the Win machine.
Time to set up your VS solution
Open the IIS admin GUI. Create a new Site. Let's say you call it MyTestSite. (you can always rename it later) Point it to your VS solution's web. Typically the same folder as web.config resides in. On the win machine: try surfing to "http://localhost/MyTestSite". Your site should show up. You might get an Apppool error.
Now try http://myWin7machine/MyTestSite on the Mac. It should work.
ROCK!
Time to set up debugging in VS
For debugging in IIS you have to connect to the process. In Win7 it requires elevated privileges so either you restart VS as admin or you try to connect and VS will do it for you.
The menu in VS is Debug->Attach to process and you choose w3wp.exe.
This is how you debug faster anyway - by connecting. Restarting your web for every debugging session is a waste of time.
To make connecting faster - use ctrl-alt-p and the continue with using the keyboard.
To make connecting even faster use a macro.
There is more info in these 4 articles: http://www.selfelected.com/tag/iis/
Set a breakpoint. Refresh your browser and the breakpoint should be hit.
Time to hack some code
Good luck!
I'm using Windows 10, VS 2015, Parallels 11 on iMac with OS X El Capitan (10.11.5). The following are the steps that worked for me:
On Windows side:
Get the IP (run ipconfig command in command window)
Get the host name (run hostname command in command window)
In control panel look for Windows Firewall -> Advanced Settings and add a new inbound rule and a new outbound rule. For both make sure you select Port, Allow Connection, TCP and specific IPs. I added a range of IPs 45000 - 45999 but you can select the range you like.
In Visual Studio:
Look for project properties and under web section change Server settings to look something like this.
Instead of "winmac" you will use the host name found in "Windows Side - Step 2". The port can be any number inside the range you setup for your firewall rules.
On Mac OS side:
Update /etc/hosts file. At the end of the file add the IP and host name that we found on steps 1 and 2 of the "Windows side" section. When you finish this step the file should like something similar to this.
Ready to debug:
Now you can start debugging in your Mac from Visual Studio. Make sure that before start the debugging process you select "Open In Mac" option (instead of Chrome or IE in your debugging options in visual studio).

"No printers are installed." problem when using excel 2003 interop sheet.PageSetup through a WCF service

We have a WCF service that generates an Excel file off of a template and feeds it back to the client in a byte array. For some reason, we are getting an error when we try to do this:
sheet.PageSetup.CenterHeader = sheet.PageSetup.CenterHeader.Replace("[customerName]", customerName).Replace("[dateTime]", date.ToShortDateString());
When it hits this line, we get this error message:
No printers are installed. To install a printer:
In Microsoft Windows 2000, click Start, point to Settings, and then click Printers. Double-click Add Printer.
In Microsoft Windows XP, click Start, and then click Printers and Faxes. Under Printer Tasks, click Add a printer.
Follow the instructions in the wizard.
The service runs under the LocalSystem account. When we first deployed this service, it was to an x64 machine and had the same issue. Our dev environment is x86 so we moved the service to another server that was x86 and it worked fine for a while. It recently stopped working and is now giving us this error message again. I am pretty sure it was becuase of a mass windows update that was done on the app server recently.
Funny thing is, I tried changing the service to "allow interaction with the desktop" and it didn't work, but when our sysadmin did that same thing, it worked for one file generation but is not working now.
There are printers installed on the machine, both on domain accounts and local accounts. I've also tried running the service under a different account, but then I wasn't able to connect to the service due to some SSPI error. We tried using the Network Service account but then the app couldn't see the service at all. We've restarted the service after each change also to no avail.
What I do know about the "PageSetup" part of the sheet object is that it needs to have a printer installed to access it at all, even if you aren't printing. I was unable to figure out a way to trick the machine into thinking the LocalSystem account has a printer installed.
We figured out the problem, I had my config file still pointed at the x64 server :(
As to why it won't work on x64 (to my knowledge) - since office 2003 is x86, it needs an x86 print spooler in order to work correctly. I don't know of any way to get an x86 print spooler on an x64 OS so we just stuck it on the x86 server.

Vista Business Login and RDP Problems

At work, I running Vista Business on a lavishly new PC, which runs great excepting two issues. In order of annoyance, but not importance:
When I reboot the machine, the Windows Splash is presented asking me to Press Ctrl + ALT + DELETE so I can logon. It takes three to five minutes and seceral key presses for me to be prompted to select my user account. After which, everything works like a charm.
As part of my duties with the firm, I am responsible for emergency work on a rotating basis and deploying patches during off-business hours. I have been given an older laptop with XPSP2 (downloading 3 for kicks right now) which I use for browsing with the intention of RDP to my desktop in the offices. If I am connected at the domain through conventional means, I am able to RDP. However, if I am using an existing broadbad connection with VPN, I am not able to get access. I am able to access other servers, desktops running a variety of OS'es including Vista.
So umm any ideas guys?
as for 2 - this happens with some proprietary VPN software (i.e. Cisco). My solution was to perform my work duties in a Virtual PC (which doesn't need its normal LAN abilities) and do my other network/internet tasks in the physical machine.
I have a Vista at work and uses my home PC to rdc in for support work. I do not experience your problem 1 so I cannot offer any advice. For your second problem have you tried the IP address instead of the machine name? We have situations where sometimes the dns resolution in the office network is not accurate.
Do you have remote access enabled, either on the machine, via group policy?
If not, you might have to go into the Control Panel\System and Maintenance\System and choose Remote Settings (from the menu on the left).
That will show you the options for Remote Deskop, including Don't allow connections, Allow connections from any version of Remote Desktop, and Allow connections from computers running Remote Desktop with Network Level Authentication (which might be the hang up you are experiencing over the VPN).
Good Luck.
I have to chalk this up to "something wierd with my laptop" as I was able to download RoyalTS and connect to the machine just fine. I had Remote connections permitted, firewall disabled, McAffee gone and others could access the machine.
The advice garnered above is excellent and useful for your typical rdp connections

Resources