Daniel15 / RouteJs

JavaScript URL routing for ASP.NET MVC and WebForms
84 stars 19 forks source link

Add note to 'Installation' documentation about validateIntegratedModeConfiguration #29

Closed stijnherreman closed 2 months ago

stijnherreman commented 10 years ago

By default, a new MVC application will have this line in web.config:

<validation validateIntegratedModeConfiguration="false" />

When this is removed and RouteJs is installed, the application will throw an error, because web.config.transform contains these lines:

        <system.web>
                <httpHandlers>
                        <add verb="GET" path="routejs.axd" type="RouteJs.RouteJsHandler, RouteJs" />
                </httpHandlers>
        </system.web>

From MSDN: ValidationSection Class [IIS 7 and higher]

IIS generates a migration error message if the ValidateIntegratedModeConfiguration property is enabled and one of the following is true:

  • ...
  • Your application defines an section in its Web.config file.
    In IIS 7 Integrated mode, the ASP.NET handler mappings are specified in a unified section inside . The section replaces both the ASP.NET and IIS script-processor-mapping configurations, which were both required to set up a ASP.NET 1.0 handler mapping.
  • ...

The solution is to remove this section. Can you add a note about this to the documentation? Or perhaps remove that part from the transform file, and add a note for IIS 6 users that they need to manually modify their web.config

Daniel15 commented 10 years ago

Note that that line is also required for IIS 7.5 with a "classic" pipeline, as the classic pipeline behaves similarly to IIS 6. I originally included this section since most other ASP.NET NuGet packages seem to include it, the company I was working at at the time was still using IIS 6.0 and this was originally developed for their use, and it should work "out of the box" on platforms that ASP.NET MVC also works on. I didn't want a broken experience for IIS 6 users.

Feel free to send a pull request containing your suggested changes to the README :)

Thanks!

stijnherreman commented 10 years ago

I'll try to make a pull request soon :)

JobaDiniz commented 10 years ago

+1

ermish commented 9 years ago

+1

As a note: my application started without this line: <validation validateIntegratedModeConfiguration="false" /> I had to add it to make RouteJs work.