asp.net - 无法通过IP地址连接ASP.NET开发服务器(VS2010)

标签 asp.net visual-studio visual-studio-2010

Visual Studio 2010/ASP.NET 项目/ASP.NET 开发服务器

我可以从我的开发计算机(运行 VS2010 的计算机)运行和调试 VS2010 ASP.NET 项目。网址:http://localhost:port/MyApp.htm工作正常。

由于我也想从 iPad 测试该应用程序,因此我需要使用其 IP 地址调用该应用程序,例如 http://192.168.0.132:port/MyApp.htm

令我惊讶的是,这不起作用,无论是从 iPad 还是从开发人员。计算机本身。这不是连接问题,地址正确/可以 ping 通。

(注意,我的机器上没有安装IIS,实际上ASP.NET应用程序是纯HTML+JS,我使用VS2010只是为了调试。)

有什么解决办法吗?

最佳答案

Visual Studio 开发服务器将仅向本地计算机提供页面:

来自Web Servers in Visual Web Developer :

If you cannot or do not want to use IIS as your Web server, you can still test your ASP.NET pages by using the ASP.NET Development Server. The ASP.NET Development Server, which is included with Visual Web Developer, is a Web server that runs locally on Windows operating systems, including Windows XP Home Edition. It is specifically built to serve, or run, ASP.NET Web pages under the local host scenario (browsing from the same computer as the Web server). In other words, the ASP.NET Development Server will serve pages to browser requests on the local computer. It will not serve pages to another computer. Additionally, it will not serve files that are outside of the application scope. The ASP.NET Development Server provides an efficient way to test pages locally before you publish the pages to a production server running IIS.

The ASP.NET Development Server only accepts authenticated requests on the local computer. This requires that the server can support NTLM or Basic authentication.

如果您希望远程测试页面,您将需要使用 IIS 或 IIS Express .

关于asp.net - 无法通过IP地址连接ASP.NET开发服务器(VS2010),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6683267/

相关文章:

c# - 如何使用 Windows 身份验证(Active Directory)在 WCF 中进行基于角色的身份验证?

asp.net - 如何让切换按钮和文本垂直堆叠以便它们的中心对齐?

c# - 向 Excel 表格添加一行

c# - 为什么 Stack Trace 显示我的开发文件路径?

asp.net - 从 scss 生成 css

jquery - 需要完成三个文本字段之一,验证不适用于强 View

c# - 从数组构建 if 条件

c# - Visual Studio 2008 - 将构建时的文件移动到 bin/

visual-studio - 在 Visual Studio 2010 中编辑 Entity Framework EDMX 模型时,如何将所有实体折叠为标题?

c - 线程安全变量 comaprison C VS2010