Wcf 查询侦听器未启动

Wcf 查询侦听器未启动,wcf,rest,odata,Wcf,Rest,Odata,我在WCF(SharePoint)中的数据服务上创建了一个QueryInterceptor 调用了“InitializeService”方法,我可以调试它, 但我的询问者不会被解雇 [QueryInterceptor("Requests")] public Expression<Func<Request, bool>> FilterRequests() { Debugger.Break(); if (SPContext.Cu

我在WCF(SharePoint)中的数据服务上创建了一个QueryInterceptor

调用了“InitializeService”方法,我可以调试它, 但我的询问者不会被解雇

[QueryInterceptor("Requests")]
    public Expression<Func<Request, bool>> FilterRequests()
    {
        Debugger.Break();
        if (SPContext.Current == null) throw new DataServiceException(401, "Permission Denied");
        var spUser = SPContext.Current.Web.CurrentUser;
        var spLoginName = spUser.LoginName;
        var spGroups = spUser.Groups.Cast<SPGroup>().Select(x => x.Name);
        if (spGroups.Any(x => x == _HRApproversGroupName))
            return (u) => true;
        throw new DataServiceException(401, "Permission Denied");
    }

public static void InitializeService(DataServiceConfiguration config)
    {
        config.SetEntitySetAccessRule("Users", EntitySetRights.AllRead);
        config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
        config.UseVerboseErrors = true;
    }
[QueryInterceptor(“请求”)]
公共表达式筛选器请求()
{
Debugger.Break();
if(SPContext.Current==null)抛出新的DataServiceException(401,“权限被拒绝”);
var spUser=SPContext.Current.Web.CurrentUser;
var spLoginName=spUser.LoginName;
var spGroups=spUser.Groups.Cast().Select(x=>x.Name);
if(spGroups.Any(x=>x==\u hrapprowsgroupname))
返回(u)=>真;
抛出新的DataServiceException(401,“权限被拒绝”);
}
公共静态void InitializeService(DataServiceConfiguration配置)
{
config.SetEntitySetAccessRule(“用户”,EntitySetRights.AllRead);
config.DataServiceBehavior.MaxProtocolVersion=DataServiceProtocolVersion.V3;
config.UseVerboseErrors=true;
}

有谁知道我做错了什么或还没有做过什么?

问题是我引用了错误的QueryInterceptor(我引用了另一个程序集,但使用了相同的名称空间)