C# Webhook InitializeReceiveGenericJsonWebHooks

Viewed 890

I receive the error:

'HttpConfiguration' does not contain a definition for 'InitializeReceiveGenericJsonWebHooks' and no accessible extension method 'InitializeReceiveGenericJsonWebHooks' accepting a first argument of type 'HttpConfiguration' could be found (are you missing a using directive or an assembly reference?)

I have the HttpConfiguration DLL and I have also installed the ASPNet Webhooks Reciever package.

public static class WebApiConfig
    {
    public static void Register(HttpConfiguration config)
    {
        // Web API routes
        config.MapHttpAttributeRoutes();
        config.Routes.MapHttpRoute(
        name: "DefaultApi",
        routeTemplate: "api/{controller}/{id}",
        defaults: new { id = RouteParameter.Optional }
    );

    // Initialize Generic JSON WebHook receiver
    config.InitializeReceiveGenericJsonWebHooks();
    }
}
1 Answers

I guess you missed the "Microsoft.AspNet.WebHooks.Receivers.Generic" nuget package. After installing it, your compiler error should disappear.

Related