1

My ASP.NET MVC site needs to be running in either IIS6 or IIS7, I need to a url with a suffix of ".mvc" when its running in IIS6.

I know I could add an AppSetting but is there away to know if the site is running in IIS6(IIS7 classic mode) or IIS7?

tereško
  • 58,060
  • 25
  • 98
  • 150
Roc Ho
  • 317
  • 1
  • 3
  • 11

2 Answers2

0

You do not need to have an extension for MVC on IIS unless you are using MVC1. MVC2 and up work just fine with extensionless URLs on IIS6.

However, to answer your question, check out this previous question: How to detect IIS version using C#?

Community
  • 1
  • 1
Tieson T.
  • 20,774
  • 6
  • 77
  • 92
  • Thanks for your answers.I dont find a way to let my MVC2 website works on IIS6 with extensionless,do you have the solution? – Roc Ho Sep 06 '12 at 02:26
  • It should "just work." Is your server up-to-date? As long as you have .NET 4+ it shouldn't need anything else. We have a dev server with Server 2003/IIS 6 and it works just fine. – Tieson T. Sep 06 '12 at 16:57
  • Thanks again,I will have a try. – Roc Ho Sep 07 '12 at 02:34
0

You can check the http response header from the client side with a browser developer tool (F12).

wisbucky
  • 33,218
  • 10
  • 150
  • 101