Hello,
We are trying to create a Web API Controller Layer using the Application Services Layer. We are using .Net Core 2.2 for this.
We created a Class Library project using the .Net Core 2.2 , but it is complaining about references
public class MyTestController : AbpApiController
{
// code goes here
}
Error: CS0012 The type 'ApiController' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
When trying to add a reference to above DLL, But, it gives an error as attached below
Appreciate any help to resolve this issue.
Vishnu
4 Answer(s)
-
0
Hi,
The related project is net461, see https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.Web.Api/Abp.Web.Api.csproj. So, you can't use AbpApiController in a .NET Core app.
-
0
Ok, thank you. So, can we expose our Application Service methods using a regular Web API Controller? Thank you for any information.
-
0
@sunilkosuri
Your app services are already exposed by default. Also, regular ASP.NET Core controllers (like this one https://github.com/aspnetzero/aspnet-zero-core/blob/dev/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Core/Controllers/TokenAuthController.cs) are exposed.
-
0
This issue is closed because it has not had recent activity for a long time.