0
paddyfink created
Hello,
I want to use a regulard Web API 2 project instead of the self-hosted project generated by the template. So i added a new web api 2 project to solution. I added the packe abp.web.api. I added the module class and the dependency
[DependsOn(
typeof(TestDataModule),
typeof(TestApplicationModule),
typeof(AbpWebMvcModule),
typeof(AbpWebApiModule))]
public class TestApiModule : AbpModule
{
public override void Initialize()
{
IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
DynamicApiControllerBuilder
.ForAll<IApplicationService>(typeof(TestApplicationModule).Assembly, "app")
.Build();
Configuration.Modules.AbpWebApi().HttpConfiguration.Filters.Add(new HostAuthenticationFilter("Bearer"));
}
}
But when I tried to call directly a service from the application project, I have 404 not found error. When I tried to call directly a controller, I have the error : "An error occurred when trying to create a controller of type 'WhateverController'. Make sure that the controller has a parameterless public constructor."
It seems like an error related to the IoC mechanism.
Am I missing something? thanx