如何从我的iPad访问我本地IIS服务器上的asp.net MVC网站(用于测试)?

时间:2022-02-11 06:22:10

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.

我正在用Visual Studio 2010开发一个应用程序。我可以在我的电脑上运行我的asp.net网站(按F5)。我想在我的iPad上运行这个网站进行测试。

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

我已经禁用了我的防火墙和杀毒软件,但它没有帮助。我的Pc的IP地址是192.168.1.6

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

在我的计算机上,我通过http://localhost:8080/运行我的网站

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

我在iPad上试试:http://192.168.1.6:8080/

I doesn't work.

我不工作。

Any help is greatly appreciated.

非常感谢您的帮助。

Thanks.

谢谢。

5 个解决方案

#1


25  

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.

如果您正在使用Visual Studio 2010,那么您可以使用IIS Express,它是一个完整的IIS,可以让Cassini发挥作用。微软强烈建议我们的开发人员停止使用Cassini作为我们的web服务器进行调试。

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.

IIS Express不仅允许您充分利用ISS(如SSL)的优点,还允许对本地网络上的任何机器(在端口80或您希望的任何其他机器上)进行完全访问。

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)

首先,我想指出Scott Hanselmen的混合视频;请参阅本视频以扩大您在IIS Express上的知识(IIS Express从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.

第二:安装了VS2010 SP1和MVC 3工具更新(您可以同时使用Web平台安装程序进行更新)后,在项目上右键单击并选择“使用IIS Express”,使用这个(而不是Cassini),您可以从本地主机上的任何一台机器*问您的调试站点。

如何从我的iPad访问我本地IIS服务器上的asp.net MVC网站(用于测试)?

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 :)

现在只需要使IIS Express在端口80上运行。为此,没有什么比阅读斯科特的博客更好的了。它是关于在端口80上运行IIS Express以及在您的开发机器/站点上运行SSL,因此,只需获取端口80上的位:)

#2


5  

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.

您可能正在使用默认的Visual Studio Web Developer服务器(Cassini),它不允许您从本地主机以外的任何地方访问站点。

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.

最简单的方法是将Web Developer Server更改为IIS Express。下面是Scott Hanselman关于如何做到这一点的一个很好的教程。您真正需要做的是单击“使用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.

不幸的是,在默认情况下,IIS Express不允许外部访问,但是也有一个简单的方法来解决这个问题。这是来自Stack Overflow的问题,它将您指向正确的解决方案。在遵循这些指令之后,IIS Express应该在本地主机之外为站点提供服务器,您应该能够使用IPad连接到页面。

Update:

更新:

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

下面是另一篇博客文章,展示了如何编辑IIS Express以允许外部访问(第3节)。

#3


2  

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

另一个选项是将应用程序配置为使用本地IIS,这将允许在默认情况下进行外部访问。

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.

为此,您可以转到项目属性> 'Web'选项卡> 'Servers' >使用本地IIS Web服务器,不要勾选'Use IIS Express',然后单击'Create virtual directory'为应用程序创建VD。

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

IIS可以通过“程序和功能”的>“添加删除窗口组件”Win7。

#4


0  

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

我认为您无法从远程机器*问Cassini (Visual Studio web服务器)。可能是错的。

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

编辑:看起来我是对的,您无法访问visual studio从远程机器上运行的Cassini实例。你需要在你的程序中构建卡西尼来远程访问它。在这里看到的

#5


0  

By using IIS Express we can view site from lan here is a link which describe how to do that Accessing local sites from Lan using IIS Express

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

#1


25  

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.

如果您正在使用Visual Studio 2010,那么您可以使用IIS Express,它是一个完整的IIS,可以让Cassini发挥作用。微软强烈建议我们的开发人员停止使用Cassini作为我们的web服务器进行调试。

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.

IIS Express不仅允许您充分利用ISS(如SSL)的优点,还允许对本地网络上的任何机器(在端口80或您希望的任何其他机器上)进行完全访问。

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)

首先,我想指出Scott Hanselmen的混合视频;请参阅本视频以扩大您在IIS Express上的知识(IIS Express从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.

第二:安装了VS2010 SP1和MVC 3工具更新(您可以同时使用Web平台安装程序进行更新)后,在项目上右键单击并选择“使用IIS Express”,使用这个(而不是Cassini),您可以从本地主机上的任何一台机器*问您的调试站点。

如何从我的iPad访问我本地IIS服务器上的asp.net MVC网站(用于测试)?

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 :)

现在只需要使IIS Express在端口80上运行。为此,没有什么比阅读斯科特的博客更好的了。它是关于在端口80上运行IIS Express以及在您的开发机器/站点上运行SSL,因此,只需获取端口80上的位:)

#2


5  

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.

您可能正在使用默认的Visual Studio Web Developer服务器(Cassini),它不允许您从本地主机以外的任何地方访问站点。

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.

最简单的方法是将Web Developer Server更改为IIS Express。下面是Scott Hanselman关于如何做到这一点的一个很好的教程。您真正需要做的是单击“使用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.

不幸的是,在默认情况下,IIS Express不允许外部访问,但是也有一个简单的方法来解决这个问题。这是来自Stack Overflow的问题,它将您指向正确的解决方案。在遵循这些指令之后,IIS Express应该在本地主机之外为站点提供服务器,您应该能够使用IPad连接到页面。

Update:

更新:

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

下面是另一篇博客文章,展示了如何编辑IIS Express以允许外部访问(第3节)。

#3


2  

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

另一个选项是将应用程序配置为使用本地IIS,这将允许在默认情况下进行外部访问。

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.

为此,您可以转到项目属性> 'Web'选项卡> 'Servers' >使用本地IIS Web服务器,不要勾选'Use IIS Express',然后单击'Create virtual directory'为应用程序创建VD。

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

IIS可以通过“程序和功能”的>“添加删除窗口组件”Win7。

#4


0  

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

我认为您无法从远程机器*问Cassini (Visual Studio web服务器)。可能是错的。

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

编辑:看起来我是对的,您无法访问visual studio从远程机器上运行的Cassini实例。你需要在你的程序中构建卡西尼来远程访问它。在这里看到的

#5


0  

By using IIS Express we can view site from lan here is a link which describe how to do that Accessing local sites from Lan using IIS Express

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