Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Debugging url rewriting within Visual Studio 2005

Status
Not open for further replies.

Gruuka

Programmer
Aug 27, 2006
24
NL
Hello all,

I was wondering about the following issue, at the moment an url rewrite module is being implemented into one of the company's sites.
However this site will need future updates so the use of debugging is needed. The problem starts with the use of the response.rewritepath method within the module, if the site is being debugged by visual studio with VS's webserver will report a 404 after trying to visit an url like 'testdomain.com/test/producta/'.

So now my colleague and I face a problem, we either create multiple projects one with the rewritten url's and one with the default links/paths, or find a way so that we can use Visual studio to debug the pages and still make use of url rewrites.

We are definitely hoping that there is an option for the last possibility.

 
this is a problem 'testdomain.com/test/producta/' because it doesn't know how to process the request if the file html, asp, asp.net, php, cgi? The same would be true for IIS or apache (using mono) you need to inform the webserver filters that this is a asp.net request.

this simplest example would be to append an aspx or the path
testdomain.com/test/producta.aspx
testdomain.com/test/producta/default.aspx
these requests are automatically routed to the asp.net processing commands.
another option would be to create your own extension. (I belive monorail uses this)
testdomain.com/test/producta.myroute
testdomain.com/test/producta/default.myroute
this would require mapping 'myroute' to the to the iisasp.net process (not sure of the exact name).

.net 3.5 has an MVC package which does this exact thing. ASP.NET MVC is the official title of the project, i believe. This is very easy to implement on IIS7. for IIS6 I have seen workarounds creating an mvc extension and mapping that to asp.net requests.

depending on the flexibility of your rewrite engine. you could use the [tt]testdomain.com/test/producta[/tt] format for testing and production servers and use [tt]testdomain.com/test/producta.aspx[/tt] for local development.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Thanks I will try that out, but there is one thing in your post that made me wonder about something.

In IIS you have the option to create a Wildcard mapping for all files and directories (you get the option to let isapi respond to every request even if it could send a 404 back).

Would you happen to know if such an option exists somewhere in VS 2k5?
 
that i don't know.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top