Tuesday, November 10, 2009

roleProvider app.config parsing troubles

I recently had the pleasure of trying to get our RC out the door, while doing that we realized that for whatever reason, Microsoft seems to use a non-standard parser for the app.config file.

Basically this does not work:

<system.web>
  <
roleManager defaultProvider="MyCustomProvider" enabled="true">
    <
providers>
      <
clear></clear>
      <
add name="MyCustomProvider" type="Namespace.MyCustomProvider, MyAssembly"/>
    </
providers>
  </
roleManager>
</
system.web>

While this does:

<system.web>
  <
roleManager defaultProvider="MyCustomProvider" enabled="true">
    <
providers>
      <
clear/>
      <
add name="MyCustomProvider" type="Namespace.MyCustomProvider, MyAssembly"/>
    </
providers>
  </
roleManager>
</
system.web>

Of course, the well known commercial installer making tool we are using insists of creating the former… :(

A workaround is to throw the file through an identity XSLT transform in a custom tool / custom action run after custom actions from said vendor have done their job.

Oh, the bug reported on connect is already closed as Won’t Fix

No comments: