I have created web services application in asp.net mvc and now need to access it from my Android device connected on same network. This is needed to debug webservies application. I do not have a static IP. The site is running with url http://localhost:27719 but I cannot access localhost from Android device. I researched web and tried below options:
Tried changing website binding information in applicationhost.config file. But I couldn't find my webstie entry in applicationhost file.
I have also tried opening the specific port 27719 in windows firewall. But that isn't working too.
I am able to access website if I host on IIS. But I need to access it when I run from Visual Studio, so that I can debug.
Please suggest how can I access webservices on my machine from Android device connected to same wifi network.
In the menu at the top of the window in Visual Studio, go to Debug, then Attach to Process (alternatively, press Control Alt P on your keyboard). It will ask you which process to attach to. Choose w3wp.exe and press Attach. The debugger will then connect to your site in IIS, and you'll be able to debug when the Android device is connected to the site.
It should be noted that you'll need to provide the IP of the server in the URL on your Android device, not "localhost".
Related
This question has been asked before (namely, here), and I've found a few blog posts that give some details about how to setup IIS Express (here and here) in order to allow remote connections, but I haven't been able to put all the pieces together for myself. Here's what I've done so far:
Ran this command at the command prompt to make a "URL Reservation":
netsh http add urlacl url=http://my-computer-name-here:80/ user=everyone
Opened up the appropriate port in my firewall:
netsh firewall add portopening TCP 80 IISExpressWeb enable ALL
Added in a new HTTP binding in my IIS Express's ApplicationHost.config for my project:
<binding protocol="http" bindingInformation="*:80:my-computer-name-here" />
After completing these steps, I'm able to run my application locally by visiting http://my-computer-name-here/. However, if I try to visit that address with any other device connected to my local network, I get redirect to my ISP's generic search page.
I also tried navigating to my computer's IP, but I hit a 403 (or a 500 when I navigate to the directory of my project's index.html, found by examining the "Physical Path" debug information provided in the error message). This happens both locally and on external devices.
What else do I need to do in order to connect to my local IIS Express development server from an external device?
In case it's relevant, I'm using the ASP.NET Web API 2 tutorial as a test project for proof of concept. I'm using Visual Studio 2013.
I've found that I am able to connect to the development server externally, but only from another Windows machine. The devices I was using to test for a remote connection (an Android phone, an iPad, and a MacBook Air) are all unable to view the application.
I've asked a new question regarding accessing the application from non-Windows machines here.
I have an ASP.NET project which developed in visual studio 2010 on my computer.
I can open its pages using address like : localhost:52413/Default.aspx .
I want to reach that page from my smartphone which is connected in same wireless network. How can i do that. First of all i tried 192.168.2.2:52413/default.aspx
What should i do?
If you are using the Visual Studio built-in development server, then you are not going to be able to open the website on another computer (or smartphone). This web server is bound to localhost. But you have three options to test your website on your smartphone:
Use IIS Express
Install IIS Express
Change project settings to use IIS Express instead of the built-in web server
Configure IIS Express to listen to remote requests.
Use IIS
Install IIS
Change project settings to use IIS (instructions for Visual Studio 2008, mostly the same in Visual Studio 2010)
Transfer your files to a web host where you have a domain name and hosting contract
For 1. and 2. you probably also need to configure your local machine's firewall to allow incoming traffic.
This can be done quite easily using Fiddler.
www.fiddler2.com
First download and install Fiddler.
Start the program and select "Tools" -> "Fiddler Options" from the menu.
In the options dialog select the "Connections" tab and check "Allow remote computers to connect".
A 'restart required' dialog may appear.
Now select "Rules" -> "Customize Rules" from the menu.
This opens a text file called "CustomRules". At the end of the "OnBeforeRequest" method (around line 188 or so) add the following:
if (oSession.host.toLowerCase() == "192.168.2.2:8888")
oSession.host = "localhost:2000";
Save the file. Close it. Restart Fiddler.
Start your web application (I usually configure the web site with a static port) like normal and verify that it's viewable on the computer through localhost:2000 (or whatever port number you have decided to use. It must match what you entered in "CustomRules", though).
Now you should be able to browse the web application from any device on your lan provided firewall and such let you by pointing a browser to http://192.168.2.2:8888
Maybe the firewall on your computer is blocking connections to port 52413. Try turning off the Windows Firewall to see if that helps.
local development server can be use only from local machine, publish to your app to or you can install UtilDev Web server (former Cassini)
I am currently trying to run my visual studio web project on a blackberry sim.
I can access my machine's IIS page from the IP address, (so when I type in 10.x.x.x, it takes me to a page for IIS).
My question is how do I access the localhost page that visual studio is running, so the page that would normally have the home Ip address in browser.
I am guessing is is (machine IP)/(something), but I dont know what the something is.
Thanks
Visual Studio often times runs testing server when you test your code from inside VS. When VS opens a new browser window and shows you the running application you should see something like:
localhost:####/WebProject
That is the location of your files on separate port (whatever is in the place of ####). However, most likely this testing server will be set to not allow remote access. What I would suggest is creating a virtual directory in iis so that you can go to 10.x.x.x/WebProject and have that point to the directory that your VS project is in.
Instructions on creating a virtual directory: http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/5adfcce1-030d-45b8-997c-bdbfa08ea459.mspx?mfr=true
How do I setup the project on the network instead of localhost? I want to setup a Remote Site, I think is the lingo
Go into visual studio
File, open website and put the website name in the box and a password to open the source.
Create a unique url name like myWebApp.mycompany.com
When I create a new website application in visual studio. When I am ready to debug Visual Studio sets all this up for me and it runs on local host automatically.
I guess in my scenario I gotta set it up manually. How do I accomplish this?
I created a new virtual directory, went through the permissions wizard and keep getting this error:
Failed to access IIS metabase.
If you are trying to deploy somewhere you can access via a windows share, it is often easier to just deploy to disk by publishing to the file system and setup the IIS bits manually. In that case, you'll need the name of the server and a share to push to.
Setting the url will be configured in IIS where you host the web app. When you are debugging in visual studio it is running a copy of the web app locally so you can test it. You shouldn't be trying to host the web app within the visual studio debugger.
To configure this you will need to set the host header for the website to myWebApp.mycompany.com. This will tell IIS that incoming requests with this domain map to this website.
I have as asp.net webserver that I hosted and I went to my mobile application I am building and made a web reference to it.
So it finds it and stuff and now I can access the web methods because of the wsdl generated. However when it tries to connect I get this:
Could not establish connection to network.
So do I have to enable something to make this work?
Take a look at this article. It explains how to setup your mobile device for internet connectivity.
Windows Mobile Emulator and Internet Connectivity
It's been awhile since i have had to do this. Perhaps it is as easy as Matt has suggested, I can remember having a hard time making this work with Windows Vista, Visual Studio 2005 and the Windows Mobile 5.0 Pocket PC Emulator. I've found a couple more articles, hope this helps.
HOWTO: Configure Network in Windows Mobile / PocketPC Device Emulator
Making Emulator to connect to the Network
I have used web services and rest based services via webrequests on the emulator without needing to configure the NE2000 adapters.
Change activesync or WMDC to connect using DMA (in wmdc: mobile device settings | connection settings, then set 'allow connections to one of the following' to DMA)
Then in VS2008, under tools select device emulator manager, and pick the emulator that is running, right click on it and select cradle, this should connect activesync/wmdc to the emulator and provide a network connection that is sufficient to communicate over http with web services.