调试ASP.NET应用程序MVC3上托管的本地IIS web服务器 [英] Debugging ASP.NET MVC3 application hosted on Local IIS Webserver

查看:326
本文介绍了调试ASP.NET应用程序MVC3上托管的本地IIS web服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经成功地使用本地IIS web服务器来承载我MVC3应用程序,我可以调试它和一切,的从承载它的机的 - 但是,当我发送一个请求从另一台机器(我的Mac,这是运行我的Windows在Parallels虚拟机),我得到预期的结果,但在调试我断点不会停止!

I've managed to use the local IIS Webserver to host my MVC3 application, and I can debug it and everything, from the machine that is hosting it. - however, when I send a request from another machine (my Mac, which is running my Windows in a Parallels VM), I get the expected result, but the debugger wont stop at my breakpoints!

我尝试添加一个 Debugger.Break(); 我的行动,而崩溃的w3wp.exe ..

I tried adding a Debugger.Break(); to my action, and that crashes the w3wp.exe ..

要,所以总结一下:本地请求的工作,并能进行调试。外部请求工作,但它们不能进行调试。

在我的项目的属性,我设置了使用本地IIS Web服务器使用IIS防爆preSS 选中

In my project's properties, I set the Use Local IIS Webserver, Use IIS Express is unchecked.

我在使用Visual Studio 2012专业版。该项目是基于SDK Azure以及附加的过程是WaIISHost.exe。

I'm using Visual Studio 2012 Professional. The project is Azure SDK-based, and the attached process is WaIISHost.exe.

推荐答案

的问题是,既然我已经建立了我的IIS服务器服务端口83,而当地我会在端口81访问,调试器不会监视这些请求。

The issue was that since I had set up my IIS server to serve on port 83, while locally I would access on port 81, the debugger would not monitor those requests.

要解决这个问题(或者,一般,到卡西尼Web服务器上远程调试),下载一个名为 rinetd工具,这是一个非常简单的流量重定向守护进程,并在文件夹中创建的config.cfg您提取它。格式为<信源IP> <信源端口> < D​​EST。 IP> <目的端口> 。所以,在我的Mac,我去在Safari中该地址:192.168.1.23:8080/Controller/Action,然后被重定向到本地主机:81 /控制器/动作,就好像它是一个本地请求!这里是该例子的config.cfg:

To solve this (or, generally, to debug remotely on the Cassini Web Server), download a tool called rinetd, which is a very simple traffic redirector daemon, and create a config.cfg in the folder where you extracted it to. The format is <source ip> <source port> <dest. ip> <dest port>. So, on my Mac, I go to this address in Safari: 192.168.1.23:8080/Controller/Action , and that is then redirected to localhost:81/Controller/Action , as if it was a local request! Here is the example config.cfg:

192.168.1.23 8080 127.0.0.1 81

另外,你可以用你的电脑名称,以避免当DHCP给你一个新的地址分配一个静态IP或更改配置:

Alternatively, you can use your PC name, to avoid having to assign a static IP or change the config when DHCP gives you a new address:

Jeff-PC 8080 127.0.0.1 81

然后,打开命令提示符, CD 您rinetd文件夹,然后运行 rinetd.exe -c的config.cfg

Then, open a command prompt, and cd to your rinetd folder, and run rinetd.exe -c config.cfg.

工程就像一个魅力。

这篇关于调试ASP.NET应用程序MVC3上托管的本地IIS web服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆