0
jawadsharif created
tried to enable HTTP attribute routing in API module configuration but after that I get exception at application start. please check attached image.
public override void Initialize() { IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
//Automatically creates Web API controllers for all application services of the application
DynamicApiControllerBuilder
.ForAll<IApplicationService>(typeof(SpeedApplicationModule).Assembly, "app")
.Build();
<span style="color:#FF0000">Configuration.Modules.AbpWebApi().HttpConfiguration.MapHttpAttributeRoutes();</span>
Configuration.Modules.AbpWebApi().HttpConfiguration.Filters.Add(new HostAuthenticationFilter("Bearer"));
ConfigureSwaggerUi(); //Remove this line to disable swagger UI.
}
2 Answer(s)
-
0
i Have figured out the issue after a bit of searching
moving following line in PreInitialize() method before ConfigureOData method call will solve the issue
Configuration.Modules.AbpWebApi().HttpConfiguration.MapHttpAttributeRoutes();
the issue was due to the sequence of httpConfiguration calls OData config was called before it
-
0
I Recomment to enable attribute routing by default