Hi!
I'am developing WebApi application based on module zero. In module class i have depends on: AbpWebApiModule, WebMeetDataModule, WebMeetApplicationModule. I have this problems:
- In Controllers dependency injection not working, my controller iherits from AbpApiController
- When I throws UserFriendlyException from Controller, this Exception is not handled. I have a <customErrors mode="On" /> in web.config.
Can anyone help me? Thanks
5 Answer(s)
-
0
Up!
-
0
Don't you have .Web project at all? How do you initialize ABP?
-
0
I don't have .Web project. My startup proejct is .Api. In this project i have class WebApiApplication which inherits AbpWebApplication. Also I have module class WebApiModule which inherits AbpModule and overrides PreInitialize and initialize.
Code: WebApiApplication <a class="postlink" href="http://codepaste.net/hwhvrr">http://codepaste.net/hwhvrr</a> WebApiModule <a class="postlink" href="http://codepaste.net/hea4ji">http://codepaste.net/hea4ji</a>
-
0
Hi,
You may need to HttpConfiguration.EnsureInitialized() call like that: <a class="postlink" href="https://github.com/aspnetboilerplate/sample-odata/blob/master/src/AbpODataDemo.WebHost/App_Start/AbpODataDemoWebModule.cs#L37">https://github.com/aspnetboilerplate/sa ... ule.cs#L37</a>
Add this to your WebMeetWebApiModule:
public override void PostInitialize() { Configuration.Modules.AbpWebApi().HttpConfiguration.EnsureInitialized(); }
Note: I hosted webapi in an empty web project in this example (<a class="postlink" href="https://github.com/aspnetboilerplate/sample-odata">https://github.com/aspnetboilerplate/sample-odata</a>).
-
0
I added this line but this still not working.
I downloaded your odata project. How can I check routing? What is address to PersonController?