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/