ASP.NET debugging redirects to invalid url

若如初见. 提交于 2020-01-06 06:59:25

问题


I'm trying to debug my application, but I can't find the correct URL to do so.

After I click F5 (start debugging) in Visual Studio 2010 I see the following in the system tray notification window:

ASP.NET Development Server  
http://localhost:1392/zz

But in the Chrome browser address that is opened the URL is:

http://www.localhost/zz/editad.aspx

and I see a notification: Oops! Google Chrome could not find www.localhost

If I change the address manually to

http://localhost:1392/zz 

it redirects back again to

http://www.localhost/zz/editad.aspx again

So I can't seem to debug my website.

I have hostsman running with the following URL's:

# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
#   ::1             localhost
192.168.0.10    www.zorgbeurs.nl
192.168.0.10    zorgbeurs.nl

Not sure if it matters but in my web.config I have. As rewrite rule:

<rule name="edit ad">?/?
<match url="^account/edit-ad/([0-9]+)?/??(/[a-zA-Z0-9-]+)?$" />
<action type="Rewrite" url="editad.aspx?id={R:1}" />
</rule>

And to prevent unauthorized access:

<location path="editad.aspx">
    <system.web>
        <authorization>
            <deny users="?" />
        </authorization>
    </system.web>
</location>

What can I do to be able to debug?

来源:https://stackoverflow.com/questions/13406936/asp-net-debugging-redirects-to-invalid-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!