Windows phone emulator to access localhost web service - xamarin

I have a webservice that I am running on a localhost (seperate project with .asmx file), and then I have a Xamarin UWP phone app that takes an input of a product code and returns certain information about it from the web service.
When I run the app in simulator mode it can connect to the local host however when I run it on a windows 10 phone emulator through visual studio it cannot connect to local host. This is a problem as I need to take screenshots of the app working in the Phone emulator.
Can anyone off suggestions to solve this please.

Related

Deploy/debug app from VS 2019 to windows 10 mobile phone via USB

I have some old windows 10 mobile phones, that I want to give a second life as a music device for my kids. Since I have Visual Studio 2019 Enterprise at my hands, I thought I try to create something myself.
Not I tried to create an UWP app and a Xamarin app and try to debug them on the phone (connected via USB, developer mode enabled, unlocked). But with both I get this error:
DEP6957: Failed to connect to device '127.0.0.1' using Universal
Authentication. Please verify the correct remote authentication mode
is specified in the project debug settings. COMException ... HRESULT:
0x8007274D) [0x8007274D]
The apps are still in their initial state after creating the project, no modifications done. The settings for debugging are set to: Debug, ARM, Device
I had some experience with an older Visual Studio version and windows phone 7, back then it just worked and all the documents I could google up suggest, while there are new ways, it should still work via USB.
If you plan to develop Windows 10 Mobile App, you need to use Visual Studio 2017 and make sure the target version of the app is below 14393.
Visual Studio 2019 no longer supports deploying UWP apps on mobile phones.
Best regards.
sometime i must reboot service something like windowsphone ipoverusb

ECONNREFUSED - Cannot connect from Android Studio to a Node.js web app on the same PC

I am developing an app in Android Studio and it makes Http calls to a Node.js web application that I am developing in Visual Studio. All these are on the same Windows 10 PC now.
The Node.js web app is running via Visual Studio 2017 and listening at port 1337. I am able to connect to localhost:1337/ from both Chrome and Edge and verify that the Node.js app is running well. However, from the Android app running in an Android emulator, when trying to connect to localhost:1337/ it got:
Exception: failed to connect to localhost/127.0.0.1 (port 1337): connect failed: ECONNREFUSED (Connection refused)
I disabled the Windows Firewall, but the same problem is still there.
If I deploy the Node.js app to a real web site on AWS, the Android app in the emulator is able to connect to that and work as expected. The downside is that I am unable to step through the Node.js app to debug.
So, on its own, the Node.js app is running fine on my PC and browsers can connect to it. On its own, the Android app is running fine on my PC, and able to connect to the Node.js app on the Internet. The problem is the Android app cannot talk to the Node.js app on the same PC.
Does the problem lie in Visual Studio, Windows or Android Studio?
As said before: localhost (127.0.0.1) is your emulator not your local computer.
check this.
How to connect to my http://localhost web server from Android Emulator in Eclipse
so use either the IP address of your computer or 10.0.2.2, which is a special alias to your host loopback interface (i.e., 127.0.0.1 on your development machine)
I think , localhost didn't work from android studio, because from emulator android studio you cannot direct access
you might be use 10.0.2.2 or 10.0.3.2 , may be this can help you
:)
Use your PC IP address. Run ifconfig/ipconfig in terminal/command prompt and look for something like an inet (or whatever looks like an IP address)
Right click on windows icon at extreme bottom left and select windows-shell or cmd and type ipconfig->enter. As it is the same conputer that Node.js is running, use the ipV4 address of ethernet adapter shown, instead of localhost in your app. Hope this helps...

Additional tool in window phone emulator not enabled

I have been trying to deploy visual studio Apache cordova tool project on window phone emulator but i am getting the following error.
windows phone emulator wasn't able to connect to the windows phone
operating system the phone didn't respond to the connect request.
When i click okay the Additional tool(>>) icon is not enable. and there is no internet on the emulator.i have remove and re install Hyper-V but is not seem to be working. I am in a Domain network with DHCP.
can you install the Windows Phone virtual switch in Hyper-V Manager and let us know if that resolves the issue?

How to debug windows phone 8 app in remote system?

I am working on project. I have taken remote system. My problem is that Visual studio and windows phone 8 device located in remote place. Windows phone 8 is connected in remote server. All sources and devices are located in remote server. I need to test and debug the app. How can i see the device screen? I want to control the device using remote server. Any software or method to take control the phone in PC?
In other words, I want to control or display the screen of windows phone 8 device on PC.
Any idea should help me a lot.
Thanks in advance.
As there is not a way to interact with a physical Windows phone 8 remotely yet (unless you are a Microsoft employee with special access to private builds of the phone), I'd suggest that the remote site set up a machine configured with Windows 8.1, Hyper-V, Visual Studio for Windows Phone, and the emulators. You can use Remote Desktop to gain access to the machine and test and debug the application through the emulators.
Or, of course, the best would be if you could just gain access to the source code for the application and do the testing locally. Depending on the resources required by the application, you may need to create a LAN to LAN VPN in which all traffic would route through the remote site.

How do I attach to an app running inside the Windows Phone emulator?

I'm trying to debug an app running inside the windows phone 7 emulator, but I can't connect to it from visual studio - Attach to Process -> selecting Windows Phone 7 Emulator transport displays an error:
"Unable to connect to 'Windows Phone 7 Emulator'. Not implemented"
What am I missing?
As a workaround:
open the solution configuration manager
next to build is a deploy column, uncheck your project
press F5
This will launch the app that is already on the device without overwriting it (and deleting its storage).
I don't think it's possible to connect to an app that is already running on the emulator.
It sounds like you're trying to connect to the emulator directly yourself,rather than the app running in it. Which I don't think is what you want anyway.
It may help if you think of the emulator as a virtual machine. That's what it is. (near enough.)
If you want to debug an app in the emulator, you need to launch it through Visual Studio.

Resources