I get this error
An error occurred when trying to create a controller of type 'AnalyticController'. Make sure that the controller has a parameterless public constructor.
Code works in test environment but not on the production server.
Any idea what could cause the problem?
This is my controller
public class AnalyticController : ApiController
{
private AnalyticBLL analyticBLL = new AnalyticBLL();
// POST api/status
public void Post(AnalyticDTO analyticDTO)
{
if (!analyticBLL.Register(analyticDTO))
helpers.BusinessLayer.CreateResponseException(analyticBLL.Errors);
}
}
ApiControllerdoes have a protected constructor, but the inheriting class doesn't seem to know that - msdn.microsoft.com/en-us/library/…:this(...)in a cyclic way.)publicdefault constructor. If you omit the chain-other-constructor syntax in an instance constructor, that is equivalent to: base().