简体   繁体   中英

How to access my asp.net MVC website on my local IIS server from my iPad (for testing)?

I'm building an app using Visual Studio 2010. I can run my asp.net website from my computer (by pressing F5). I would like to run this website on my iPad for testing purpose.

I already disabled my Firewall and Antivirus but It doesnt' help. The IP address of my Pc is 192.168.1.6

From my computer I run my website from http://localhost:8080/

From my iPad I tried: http://192.168.1.6:8080/

I doesn't work.

Any help is greatly appreciated.

Thanks.

If you are using Visual Studio 2010 then you can use the IIS Express , which is a FULL IIS that puts Cassini on its knees. Microsoft strongly suggest that we developers stop using Cassini as our web server for debugging.

IIS Express lets you not only take the full advantages of ISS such as SSL, but enable full access for any machine on your local network, acting on port 80 or any other you would like.

First: I would like to point out the MIX Video from Scott Hanselmen about this; see this video to enlarge your knowledge on IIS Express (IIS Express starts on 32:50 )

Second: After you installed VS2010 SP1 and MVC 3 Tools Update (you can update both using Web Platform Installer ) right-click on your project and choose "Use IIS Express", and with this (instead Cassini) you can access your debug site from any machine on your localhost.

在此输入图像描述

Now you just need make IIS Express to run on port 80 . And for that, there's nothing better than to read Scott's Blog on it . It's about running IIS Express on port 80 as well running SSL on your dev machine/site so, just grab the bits on port 80 part :)

You are probably using the default Visual Studio Web Developer Server (Cassini) which doesn't allow one to access the site from anywhere else than the localhost.

The easiest way around this is to change from the Web Developer Server to IIS Express. Here's a good tutorial by Scott Hanselman on how to do this. The only thing you really need to do is to click the Use IIS Express-button.

Unfortunately, by default, the IIS Express doesn't allow external access but there's an easy way around this problem too. Here's question from Stack Overflow which points you to the correct solution. After following those instructions the IIS Express should server the site outside the localhost and you should be able to connect to the page using your IPad.

Update:

Here's an another blog post which shows how to edit the IIS Express to allow external access (Section 3).

The other option would be to configure your application to use your local IIS, which will allow external access by default.

To do this, you can go to your project properties > 'Web' tab > 'Servers' > Use Local IIS Web server, don't tick 'Use IIS Express' and then click 'Create virtual directory' to create a VD for your application.

IIS can be enabled via 'Programs & Features' > 'Add Remove Windows Components' on Win7

通过使用IIS Express,我们可以从lan查看站点这里有一个链接,描述如何使用IIS Express从Lan访问本地站点

I don't think you can access Cassini (the Visual Studio web server) from a remote machine. Might be wrong though.

Take a look at this question for a possible solution

Edit: Looks like I'm correct, you are not able to access the instances of Cassini that visual studio runs up from a remote machine. You need to actually build Cassini into your program to access it remotely. See here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM