Home > Net >  How to use AddProblemDetails extension in class library?
How to use AddProblemDetails extension in class library?

Time:11-14

I want to write custom extension using brand new Asp.Net Core 7.0 AddProblemDetails extension in class library.

I tried to add Microsoft.AspNetCore.Http.Extensions and Microsoft.Extensions.DependencyInjection nuget packages, but that didn't help. What package reference should I include to do that?

CodePudding user response:

If you want to use the ASP.NET Core shared framework in a class library project - add FrameworkReference element for Microsoft.AspNetCore.App:

<ItemGroup>
    <FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
  • Related