2

I've got a route setup which handles "{Object}/{Operation}/{Name}".

Routing works perfectly if I make a request for: http://localhost/Software/Download/Filenameexe (note that no forward slash is needed when no file extension is specified). The request also succeeds when I make the request: http://localhost/Software/Download/Filename.exe/ (note the trailing forward-slash).

But I get a 404 when I make a request for: http://localhost/Software/Download/Filename.exe (this time with a file extension and no trailing forward-slash).

Everything works beautifully when using the built-in Visual Studio 2010 development asp.net web-server, but when I fire the site up in in IIS, it simply throws 404s unless I append the trailing forward-slash.

How can I make the ASP.net routing engine less picky and accept all of the examples?

  • http://localhost/Software/Download/Filename.exe
  • http://localhost/Software/Download/Filenameexe
  • http://localhost/Software/Download/Filename.exe/

1 Answer 1

5

Check my answer to this question, I think you're dealing with the same issue. You may need to specify runAllManagedModulesForAllRequests="true", or add an HTTP handler for .exe files, to make sure that ASP.NET processes requests for .exe files. If ASP.NET doesn't process the files, your route won't be followed.

Sign up to request clarification or add additional context in comments.

2 Comments

If your anywhere near Charlotte NC - drinks are on me!
Spent hours looking for this, only I was trying to route .jpg instead of .exe. Thanks for the help!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.