로드 나는 관련 구성을 추가하지만 난 내 사용자 정의 확장이라는 방법이있다WCF 오류 : 확장은 내가 <code>IDispatchMessageInspector</code>보다 우선 내 프로젝트에 클래스를 정의
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)
작동하지 않습니다입니다 수 없습니다
<endpointBehaviors>
<behavior name="jsonBehavior">
<enableWebScript/>
<customHeaders/>
<!--<webHttp/>-->
</behavior>
</endpointBehaviors>
이 은
<behaviorExtensions>
<add name="customHeaders" type="InMotionGIT_NT.Address.Service, CustomHeaders, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
</behaviorExtensions>
이 여기있어 난 내 사용자 지정 확장을 정의하는 방법이다 내가 정의 클래스, 즉
[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)
{
}
}
내가 구성에서 뭔가를 그리워 내 프로젝트의 내부입니까?