I've removed code that is shared between two applications into a shared project which includes controllers. Im getting the "Multiple types were found that match the controller named" error. I'm not sure why this is happening. So this is my shared controller
namespace App.Web.Shared.Controllers
{
public class ParkingTicketController : BaseController
{
public ParkingTicketController(ServiceLocator serviceLocator) : base(serviceLocator)
{
}
/// <summary>
/// Views the specified identifier.
/// </summary>
/// <param name="publicId">The public identifier.</param>
/// <returns></returns>
[AuthorizeAccess(Roles = ApplicationRoles.None)]
public ActionResult Display(string publicId)
{
//Shared
}
}
}
namespace App.Web.Driver.Controllers
{
[AuthorizeAccess(Roles = ApplicationRoles.Driver)]
public class ParkingTicketController : Shared.Controllers.ParkingTicketController
{
//
// GET: /ParkingTicket/
/// <summary>
/// Initializes a new instance of the <see cref="ParkingTicketController"/> class.
/// </summary>
/// <param name="serviceLocator">The service locator.</param>
public ParkingTicketController(ServiceLocator serviceLocator) : base(serviceLocator)
{
}
}
}
This is the route set up. So it should match the driver Controller
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional},
namespaces: new[] { "App.Web.Driver.Controllers" });
I'm simply calling it from my view
@Html.ActionLink("View Print", "Display", "ParkingTicket", new { id = Model.ParkingTicket.PublicId }, new { @class = "btn btn-blue" })
Error message
