简体   繁体   English

如何允许对Visual Studio 2013 Web调试的远程访问

[英]How to allow remote access to Visual Studio 2013 web debug

I am developing a Web API project in ASP.Net using Visual Studio 2013. 我正在使用Visual Studio 2013在ASP.Net中开发Web API项目。

When I click debug it launches the website in IIS and displays it in Chrome browser. 当我单击debug时,它将在IIS中启动网站并在Chrome浏览器中显示它。 However, I cannot access it from another device. 但是,我无法从其他设备访问它。

I need to access the API from my mobile device for testing purposes. 我需要从移动设备访问API进行测试。 How can I perform remote debugging in Visual studio 2013? 如何在Visual Studio 2013中执行远程调试?

there were few posts concerning this topic here ( one , two ). 这里很少有关于这个话题的文章( )。 I faced the same problem recently and the most sufficent post I found was this one . 我最近面临同样的问题,最sufficent后我发现了这一个

Your device is running under AVD emulator ? 您的设备正在AVD模拟器下运行?
I suggest follow this steps: 我建议按照以下步骤操作:

  1. Install IIS 安装IIS
  2. Configure Visual Studio to use local IIS (Page properties in your Web Project) 配置Visual Studio以使用本地IIS(Web项目中的页面属性)
  3. Create a exclusive AppPool in IIS to work with your application 在IIS中创建专有的AppPool以与您的应用程序一起使用
  4. In my Project I'm using Oracle Client and must be 32bits (64 bits don't works with Visual Studio) then I need allow 32 bit in Application Pool 在我的项目中,我使用的是Oracle Client,必须为32位(64位不适用于Visual Studio),然后我需要在应用程序池中允许32位
  5. Configure the Windows firewall to allow request in port 80 (inbound rules) 配置Windows防火墙以允许端口80中的请求(入站规则)
  6. In your device use the intranet IP DON'T USE LOCALHOST OR 127.0.0.1, because some emulators works under another IP 在您的设备中使用Intranet IP请勿使用LOCALHOST或127.0.0.1,因为某些仿真器可以在另一个IP下工作

From Handling url binding failures in IIS Express : 处理IIS Express中的URL绑定失败

Serving External Traffic 服务外部流量

To enable your website to serve external traffic, you need to configure HTTP.sys and your computer's firewall. 为了使您的网站能够提供外部流量,您需要配置HTTP.sys和计算机的防火墙。 From an elevated command prompt, run the following command: 在提升的命令提示符下,运行以下命令:

netsh http add urlacl url=http://myhostname:8080/ user=everyone 

After configuring HTTP.sys, you can configure IIS Express to use port 8080 by using WebMatrix or Visual Studio 2010 SP1 Beta+, or by editing the applicationhost.config file to include the following binding in the sites element. 配置HTTP.sys之后,可以通过使用WebMatrix或Visual Studio 2010 SP1 Beta +,或通过编辑applicationhost.config文件以将以下绑定包含在sites元素中,来将IIS Express配置为使用端口8080。 (Replace myhostname with your computer's domain name). (将myhostname替换为计算机的域名)。

<binding protocol="http" bindingInformation="*:8080:myhostname"/> 

You will also need to configure the firewall to allow external traffic to flow through port 8080. 您还需要配置防火墙,以允许外部流量通过端口8080流动。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Visual Studio 2013中使用IIS(而不是Express)进行调试 - How to debug with IIS (not Express) in Visual Studio 2013 允许在Visual Studio Express 2013 for Web中加载JSON文件 - Allow loading of JSON files in Visual Studio Express 2013 for Web 如何在Visual Studio Express 2013中通过本地IIS运行Web项目 - How to run web project by local IIS in visual studio express 2013 Visual Studio 2013 Web部署程序包失败 - Visual Studio 2013 Web Deployment Package failed Visual Studio 2013-网站安装程序项目 - Visual Studio 2013 - Web Site installer project 附加到Visual Studio Express 2013 for Web中的进程 - Attach to process in Visual Studio Express 2013 for Web Visual Studio 2013:无法访问IIS元数据库 - Visual Studio 2013: Unable to access IIS metabase Visual Studio 2013.您没有足够的权限访问计算机上的IIS网站 - Visual Studio 2013. You do not have sufficient privilege to access IIS web sites on your machine VS2013 Pro:在远程IIS上调试网站 - VS2013 Pro: debug web site on remote IIS 无法在 Web 服务器上开始调试。 远程服务器返回错误:(404) 未找到。 在 Visual Studio 中启动调试时出错 - Unable to start debugging on the web server. The remote server returned an error: (404) Not Found. Error when starting debug in Visual Studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM