Hosting a WCF service in WAS/AppFabric that contain behaviorExtensions

ロック済み Hosting a WCF service in WAS/AppFabric that contain behaviorExtensions

  • 2010年2月12日 21:45
     
     
    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?? 

すべての返信

  • 2010年2月13日 0:43
     
     回答済み
    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
    • 回答の候補に設定 Chris Craft 2010年2月13日 0:44
    • 回答としてマーク Shawn of T 2010年2月16日 15:55
    •  
  • 2010年2月16日 15:58
     
     
    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
  • 2010年2月16日 16:13
     
     
    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
  • 2010年3月2日 4:29
     
     
    Chris, It looks like this problem hasn’t been resolved in Beta2. Am I correct? Thanks Roman
  • 2010年3月2日 8:45
     
     
    That's correct, Roman. If you have custom behaviors you'll need to write the MWA schema for them.
  • 2010年3月2日 23:05
     
     

    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
  • 2010年3月3日 4:09
     
     
    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
  • 2010年3月3日 4:59
     
     
    Hi Fabrice,


    That's a good news.


    Thanks

    Roman
    Roman Kiss, MVP Connected System Developer
  • 2012年1月12日 0:57
     
     
    Can you please provide a link to the hotfix or the KB number ?