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

  • Home
  • SEARCH
  • 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 7994793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:13:13+00:00 2026-06-04T14:13:13+00:00

I defined a class in my project which overrides IDispatchMessageInspector and I added the

  • 0

I defined a class in my project which overrides IDispatchMessageInspector and I added the configuration related but it’s doesn’t work

System.Configuration.ConfigurationErrorsException: The type ‘InMotionGIT_NT.Address.Service, CustomHeaders, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’ registered for extension ‘customHeaders’ could not be loaded. (C:\Users\jmachado\Documents\Visual Studio 2010\Projects\InMotionGIT_NT\Address Service\InMotionGIT_NT.Address.Service\bin\Debug\InMotionGIT_NT.Address.Service.dll.config line 67)

this is how i called my custom extension

<endpointBehaviors>
    <behavior name="jsonBehavior">
        <enableWebScript/>
        <customHeaders/>
        <!--<webHttp/>-->
    </behavior>
</endpointBehaviors>    

this is how i defined my custom extension

<behaviorExtensions>
    <add name="customHeaders" type="InMotionGIT_NT.Address.Service, CustomHeaders, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
</behaviorExtensions>

Here’s the class that I defined, that’s inside of my project

[AttributeUsage(AttributeTargets.Class)]
public class CustomHeaders : IDispatchMessageInspector
{
    public object AfterReceiveRequest(ref Message request, ClientChannel channel, InstanceContext instanceContext)
    {
        if ((WebOperationContext.Current.IncomingRequest.Method == "GET"))
        {
            WebOperationContext.Current.OutgoingResponse.Headers.Add("Access-Control-Allow-Origin", "*");
            WebOperationContext.Current.OutgoingResponse.Headers.Add("Access-Control-Allow-Methods", "POST");
            WebOperationContext.Current.OutgoingResponse.Headers.Add("Access-Control-Allow-Headers", "Content-Type, Accept");
        }
        return null;
    }

    public void BeforeSendReply(ref Message reply, object correlationState)
    {
    }
}

Do I miss something in the configuration?

  • 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-06-04T14:13:14+00:00Added an answer on June 4, 2026 at 2:13 pm

    Change your type definition. First, specify the full type name (namespace + class name). After a comma, place the name of the DLL holding your type. And then the rest for a fully qualified type name. Like this:

    <behaviorExtensions>
        <add name="customHeaders" type="InMotionGIT_NT.Address.Service.CustomHeaders, <DLLName> , Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
    </behaviorExtensions>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assuming I have a shared activity class defined in a Library project, which does
The Problem: I have a forms project which instantiates a class that is defined
I am trying to use (*env)->RegisterNatives to add methods to a defined class which
I have a Class Library project which houses some shared code between other projects
I've got a project which has in it a protocol, a class implementing that
For my project, the role of the Lecturer (defined as a class) is to
I have an executable project called A.EXE which references a C# class library B.DLL.
While you create a user defined class in Java, you do not specify it
I defined next class with virtual properties: public class Order: BaseEPharmObject { public Order()
I have defined a class A and derived a new class B from A

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.