Q:

Strange Configuration Error in web.config

I am getting the following error in my WebApi application:
An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: Unrecognized attribute 'MaxCachedResults'. Note that attribute names are case-sensitive.
This is my roleManager entry in web.config and as you can see I am not specifying the MaxCachedResults attribute, although I did add this initially, I removed it so it's no longer being used and I'm not sure where it's picking this up from.
<roleManager enabled="true" defaultProvider="MyRoleProvider" cacheRolesInCookie="false">
  <providers>
    <clear />
    <add name="MyRoleProvider" type="SiteWorksAPI.RoleProviders.MyRoleProvider, SiteWorksAPI" connectionStringName="SiteWorks" applicationName="/" />
  </providers>
</roleManager>

The error happens when I call var resp = await _httpClient.GetAsync(resourceUri) and inspecting resp.Content.ReadAsStringAsync().Result displays a 'Configuration Error' HTML page with the above error message.
I have tried all of the following with any success:

Rebooted my PC
Recycled the application pools
Restarted IIS
Cleared down the Tempoary ASP.NET directory

Does anyone know what's going on here?

A:

It seems that Castle Windsor was caching an older copy of the web.config file.  After changing the caching options on the WebRequestHandler I was able to get the HttpClient to pick up the new web.config file.

