I am trying to use Webapi, not exposing the service as webapi.
Hi
I am getting the following error, any idea?
INFO 2017-02-03 22:20:52,342 [4 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET <a class="postlink" href="http://localhost:3002/api/values">http://localhost:3002/api/values</a>
DEBUG 2017-02-03 22:20:52,343 [4 ] NetCore.StaticFiles.StaticFileMiddleware - The request path /api/values does not match a supported file type
DEBUG 2017-02-03 22:20:52,727 [4 ] osoft.AspNetCore.Routing.Tree.TreeRouter - Request successfully matched the route with name '' and template 'api/Values'.
DEBUG 2017-02-03 22:20:52,753 [4 ] t.AspNetCore.Mvc.Internal.ActionSelector - Action 'P.WebApi.Controllers.ValuesController.Post (P.WebApi)' with id '0c571ae3-a45f-4851-b09a-bb26a38679b0' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint'
DEBUG 2017-02-03 22:20:54,494 [4 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action P.WebApi.Controllers.ValuesController.Get (P.WebApi)
ERROR 2017-02-03 22:20:54,532 [4 ] Mvc.ExceptionHandling.AbpExceptionFilter - No component for supporting the service P.WebApi.Controllers.ValuesController was found
Castle.MicroKernel.ComponentNotFoundException: No component for supporting the service P.WebApi.Controllers.ValuesController was found
at Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, IDictionary arguments, IReleasePolicy policy)
at Castle.Windsor.MsDependencyInjection.ScopedWindsorServiceProvider.GetServiceInternal(Type serviceType, Boolean isOptional)
at Microsoft.AspNetCore.Mvc.Controllers.DefaultControllerFactory.CreateController(ControllerContext context)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeAllActionFiltersAsync>d__26.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeExceptionFilterAsync>d__25.MoveNext()
DEBUG 2017-02-03 22:20:54,746 [4 ] ore.Mvc.Internal.ControllerActionInvoker - Request was short circuited at exception filter 'Abp.AspNetCore.Mvc.ExceptionHandling.AbpExceptionFilter'.
DEBUG 2017-02-03 22:20:54,762 [4 ] etCore.Mvc.Internal.ObjectResultExecutor - No information found on request to perform content negotiation.
DEBUG 2017-02-03 22:20:54,764 [4 ] etCore.Mvc.Internal.ObjectResultExecutor - Selected output formatter 'Microsoft.AspNetCore.Mvc.Formatters.JsonOutputFormatter' and content type 'application/json' to write the response.
INFO 2017-02-03 22:20:54,765 [4 ] etCore.Mvc.Internal.ObjectResultExecutor - Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext.
INFO 2017-02-03 22:20:54,949 [4 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action P.WebApi.Controllers.ValuesController.Get (P.WebApi) in 453.4387ms
INFO 2017-02-03 22:20:54,952 [4 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 2609.9596ms 500 application/json; charset=utf-8
DEBUG 2017-02-03 22:20:54,954 [4 ] Microsoft.AspNetCore.Server.Kestrel - Connection id "0HL2C7VD30583" completed keep alive response.
My controller
[Produces("application/json")] [Route("api/Values")] public class ValuesController : ERPControllerBase { // GET api/values [HttpGet] public IEnumerable<string> Get() { return new string[] { "value1", "value2" }; }
// GET api/values/5
[HttpGet("{id}")]
public string Get(int id)
{
return "value";
}
INFO 2017-02-03 13:16:17,077 [22 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 POST <a class="postlink" href="http://localhost:3002/api/Register">http://localhost:3002/api/Register</a> application/json; charset=utf-8 121 DEBUG 2017-02-03 13:16:17,078 [22 ] NetCore.StaticFiles.StaticFileMiddleware - POST requests are not supported DEBUG 2017-02-03 13:16:17,078 [22 ] osoft.AspNetCore.Routing.Tree.TreeRouter - Request successfully matched the route with name '' and template 'api/Register'. DEBUG 2017-02-03 13:16:17,085 [22 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action P.WebApi.Controllers.RegisterController.Post (P.WebApi) ERROR 2017-02-03 13:16:17,086 [22 ] Mvc.ExceptionHandling.AbpExceptionFilter - No component for supporting the service P.WebApi.Controllers.RegisterController was found Castle.MicroKernel.ComponentNotFoundException: No component for supporting the service P.WebApi.Controllers.RegisterController was found at Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, IDictionary arguments, IReleasePolicy policy) at Castle.Windsor.MsDependencyInjection.ScopedWindsorServiceProvider.GetServiceInternal(Type serviceType, Boolean isOptional) at Microsoft.AspNetCore.Mvc.Controllers.DefaultControllerFactory.CreateController(ControllerContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeAllActionFiltersAsync>d__26.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeExceptionFilterAsync>d__25.MoveNext() DEBUG 2017-02-03 13:16:17,087 [22 ] ore.Mvc.Internal.ControllerActionInvoker - Request was short circuited at exception filter 'Abp.AspNetCore.Mvc.ExceptionHandling.AbpExceptionFilter'. DEBUG 2017-02-03 13:16:17,087 [22 ] etCore.Mvc.Internal.ObjectResultExecutor - No information found on request to perform content negotiation. DEBUG 2017-02-03 13:16:17,087 [22 ] etCore.Mvc.Internal.ObjectResultExecutor - Selected output formatter 'Microsoft.AspNetCore.Mvc.Formatters.JsonOutputFormatter' and content type 'application/json' to write the response. INFO 2017-02-03 13:16:17,087 [22 ] etCore.Mvc.Internal.ObjectResultExecutor - Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. INFO 2017-02-03 13:16:17,087 [22 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action Keredwell.ERP.WebApi.Controllers.RegisterController.Post (P.WebApi) in 2.0728ms INFO 2017-02-03 13:16:17,087 [22 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 10.2542ms 500 application/json; charset=utf-8