Matthew Matthew - 15 days ago 6x
ASP.NET (C#) Question

<rewrite> not a valid child of <system.web>?

Hopefully I am just overlooking something incredibly simple, if so I apologize....

I have an ASP.NET application in .NET4 and we're trying to use URL rewriting using


For some reason intellisense is returning an error which says that
is not a valid child element of

When I build it and run it, it says something akin to "Error at line 0 in web.config"

If I remove all the
lines it works properly (but of course no rewriting)

Is there a switch I need to flip on or something? It has to be something I'm stupidly overlooking....


EDIT: Turned out IIS was borked. Vote to close.


Did you make sure you're targeting Framework 4.0?

<compilation targetFramework="4.0"/>