Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5965483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:38:10+00:00 2026-05-22T19:38:10+00:00

Hi I have my own ServiceBehavior: public class StructureMapServiceBehavior : IServiceBehavior { public void

  • 0

Hi I have my own ServiceBehavior:

public class StructureMapServiceBehavior : IServiceBehavior
    {
        public void ApplyDispatchBehavior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
        {
            foreach (ChannelDispatcherBase cdb in serviceHostBase.ChannelDispatchers)
            {
                ChannelDispatcher cd = cdb as ChannelDispatcher;
                if (cd != null)
                {
                    foreach (EndpointDispatcher ed in cd.Endpoints)
                    {
                        ed.DispatchRuntime.InstanceProvider =
                            new StructureMapInstanceProvider(serviceDescription.ServiceType);
                    }
                }
            }
        }

        public void AddBindingParameters(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase, Collection<ServiceEndpoint> endpoints, BindingParameterCollection bindingParameters)
        {
        }

        public void Validate(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
        {
        }

    }

How i can add it in App.config with WCF configuration tool ?

:
WCF configuration tool

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:38:11+00:00Added an answer on May 22, 2026 at 7:38 pm

    Create a class that inherit from BehaviorExtensionElement:

    public class StructureMapServiceBehaviorElement : BehaviorExtensionElement
    {
        public override Type BehaviorType
        {
            get { return typeof(StructureMapServiceBehavior ); }
        }
    
        protected override object CreateBehavior()
        {
            return new StructureMapServiceBehavior ();
        }
    }
    

    Then register your extension in the config file:

    <behaviorExtensions>
        <add name="timeService" type="YourAssembly.StructureMapServiceBehaviorElement ,
    YourAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
    </behaviorExtensions>
    

    When that is done you can use your extension like any other.

    EDIT: To do it using the configuration tool, it is similar. Once the class above is created, register your behavior in the extensions section of the WCF configuration tool (advanced->extensions->behavior element extensions)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have own collection DataContracts: [DataContract] public class DzieckoAndOpiekun { public DzieckoAndOpiekun() { }
I'm trying to hide window after its startup. I have own window-class which is
I have my own custom LinkedList class that has a pointer to the first
I have my own exception handler: module Frog module Errors class NotFound < FrogError
I have my own ITrigger . Basically, it looks like the below: public interface
I have my own model classes, which are public, but when making a view,
I have my own TextBox2 class that derives from TextBox. I want to add
I have my own User Class, which inherits FOS\UserBundle\Entity\User . Additionally I wrote my
I have my own SQL based session class. I want to automatically commit the
We have our own ORM we use here, and provide strongly typed wrappers for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.