You are using Microsoft.AspNet.WebApi.Core version 5.0.0 which uses System.Web.Http version 5.0.0 And in this version RoutePrefixAttribute is marked as sealed so you can not extend it:
namespace System.Web.Http
{
/// <summary>
/// Annotates a controller with a route prefix that applies to all actions within the controller.
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public sealed class RoutePrefixAttribute : Attribute
{
/// <summary>
/// Gets the route prefix.
/// </summary>
public string Prefix { get; private set; }
/// <summary>
/// Initializes a new instance of the <see cref="T:System.Web.Http.RoutePrefixAttribute"/> class.
/// </summary>
/// <param name="prefix">The route prefix for the controller.</param>
public RoutePrefixAttribute(string prefix)
{
if (prefix == null)
throw Error.ArgumentNull("prefix");
this.Prefix = prefix;
}
}
}
Either derive from System.Web.Mvc.RoutePrefixAttribute or update your Microsoft.AspNet.WebApi.Core to latest version. Here is the implementation for version 5.2.3. As you can see the class is not selaed there:
namespace System.Web.Http
{
/// <summary>
/// Annotates a controller with a route prefix that applies to all actions within the controller.
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
public class RoutePrefixAttribute : Attribute, IRoutePrefix
{
/// <summary>
/// Gets the route prefix.
/// </summary>
public virtual string Prefix { get; private set; }
/// <summary>
/// Initializes a new instance of the <see cref="T:System.Web.Http.RoutePrefixAttribute"/> class.
/// </summary>
protected RoutePrefixAttribute()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="T:System.Web.Http.RoutePrefixAttribute"/> class.
/// </summary>
/// <param name="prefix">The route prefix for the controller.</param>
public RoutePrefixAttribute(string prefix)
{
if (prefix == null)
throw Error.ArgumentNull("prefix");
this.Prefix = prefix;
}
}
}