views:

61

answers:

3

I've created a WCF 4 Router Service and am hosting it in IIS7. It works fine on my development machine, but when I deploy to the QA server is returns the following message:

The configuration section 'routing' cannot be read because it is missing a section declaration

The section it's complaining about is the standard WCF4 routing section:

   <routing>
      <filters>
        <filter name="MatchAllFilter1" filterType="MatchAll" />
      </filters>
      <filterTables>
        <filterTable name="ServiceRouterTable">
          <add filterName="MatchAllFilter1" endpointName="WCF_XXXService" />
        </filterTable>
      </filterTables>
    </routing>

This should be stock standard, but I'm receiving the above error from IIS. Does anyone have any suggestions on how I can fix this issue?

A: 

A quick Google turned up this:

If you upgrade a site to .NET 4, and don’t upgrade the application pool to use .NET 4, you will get this. The machine.config file for .NET 4 declares this section, and earlier version did not have it (unless you manually added it). In IIS 7, with the site select, choose Basic Settings in the right pane. This will bring up a dialog that contains the name of your application pool. Then select the application pools tree node and the application pool from the list that shows up. Choose Basic Settings from the right pane here, and you can change the framework version.

From here

StephaneT
Thanks for the reply, but I can confirm I am running Framework 4.0 for the Application Pool and the Website.
Dion
+1  A: 

Ok, finally found the solution here:

The root configuration files (the machine.config file and the root Web.config file) for the .NET Framework 4 (and therefore ASP.NET 4) have been updated to include most of the boilerplate configuration information that in ASP.NET 3.5 was found in the application Web.config files. Because of the complexity of the managed IIS 7 and IIS 7.5 configuration systems, running ASP.NET 3.5 applications under ASP.NET 4 and under IIS 7 and IIS 7.5 can result in either ASP.NET or IIS configuration errors.

We recommend that you upgrade ASP.NET 3.5 applications to ASP.NET 4 by using the project upgrade tools in Visual Studio 2010, if practical. Visual Studio 2010 automatically modifies the ASP.NET 3.5 application's Web.config file to contain the appropriate settings for ASP.NET 4.

READ MORE HERE: aspnet4 breaking-changes

Dion
A: 

Can you try re-running aspnet_regiis from the FrameworkXXX\microsoft.net\v4.0.30319 folder and reset IIS?

Sajay
Thanks, but yes, tried that too. Had to manually edit the machine and root config in the end. See my solution above.
Dion