Hosting a WCF service in WAS/AppFabric that contain behaviorExtensions

Locked Hosting a WCF service in WAS/AppFabric that contain behaviorExtensions

  • Friday, February 12, 2010 9:45 PM
     
     
    In my app.config I have my own behaviorExtension elements, like shown on msdn here:

    Although the service is hosted successfully (and the behaviors are loaded and used as expected), when I try to configure the service in the IIS Manager (right-click -> .Net 4 WCF and WF -> Configure...) I get an error alert with the following text:

    [Window Title]
    Configure WCF and WF for Application

    [Main Instruction]
    An error occurred when retrieving configuration. Review details for additional information.

    [Content]
    Filename: \\?\D:\path\to\my\service\web.config
    Line number: 85
    Error: Unrecognized element 'MyBehavior'

    [OK]


    Has anyone successfully hosted a service containing custom behaviorExtensions elements in their app.config?? 

All Replies

  • Saturday, February 13, 2010 12:43 AM
     
     Answered
    Hello, AppFabric uses Microsoft Web Administration (MWA) to manage configuration. MWA requires that all the config elements be schematized. Here is some information about how you can create a schema for your custom behaviors. http://learn.iis.net/page.aspx/242/extending-iis7-schema-and-accessing-the-custom-sections-using-mwa/ http://social.msdn.microsoft.com/Forums/en-US/dublin/thread/2cfb3eac-b600-4a9f-8712-233c7d063b7b/ (This is a forum post where I show a sample schema file.) Thanks, chris
    • Proposed As Answer by Chris Craft Saturday, February 13, 2010 12:44 AM
    • Marked As Answer by Shawn of T Tuesday, February 16, 2010 3:55 PM
    •  
  • Tuesday, February 16, 2010 3:58 PM
     
     
    Thanks Chris that worked like a charm.

    It is unfortunate that I need to install and maintain a file in a system folder (%windir%\system32\inetsrv\config\schema\)
    ...was hoping for a better extensibility story since WCF handles that kind of thing without requiring schemas.

    SF
  • Tuesday, February 16, 2010 4:13 PM
     
     
    I'm glad that worked for you. We're looking at an enhancement to MWA that would allow us to ignore configuration sections that aren't schematized, so that they wouldn't cause errors in our tools. That fix is looking promising. For now, though, you'll need to add the schema file as you did.

    --chris
  • Tuesday, March 02, 2010 4:29 AM
     
     
    Chris, It looks like this problem hasn’t been resolved in Beta2. Am I correct? Thanks Roman
  • Tuesday, March 02, 2010 8:45 AM
     
     
    That's correct, Roman. If you have custom behaviors you'll need to write the MWA schema for them.
  • Tuesday, March 02, 2010 11:05 PM
     
     

    Chris,

    Thanks for prompt reply.

    There is no problem to create a sectionSchema for custom bindings/behaviors elements. It’s working well. I can see a problem to manage this schema extension across multiple applications.

    What is the solution for next release (RC) around this issue?

     Thanks

    Roman


    Roman Kiss, MVP Connected System Developer
  • Wednesday, March 03, 2010 4:09 AM
     
     
    Hi Roman,

    We now have a Windows Hotfix that will fix this issue.
    The hotfix has been approved and is undergoing final testing. If all goes according to plan, the hotfix should be available shortly on the download center. Note that you don't need to wait for RC to enjoy the hotfix: as soon as it becomes available you can start using it with your AppFabric Beta2 deployments.

    Thanks,
    Fabrice
  • Wednesday, March 03, 2010 4:59 AM
     
     
    Hi Fabrice,


    That's a good news.


    Thanks

    Roman
    Roman Kiss, MVP Connected System Developer
  • Thursday, January 12, 2012 12:57 AM
     
     
    Can you please provide a link to the hotfix or the KB number ?