OpenAPI extension does not work when using EF Core >= 3.0
See original GitHub issueHi all,
Today I faced an issue when I started to use EF Core in my function app.
Error:
Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions, Version=3.1.16.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()
at System.Reflection.RuntimeMethodInfo.GetParameters()
at Microsoft.Azure.WebJobs.Extensions.OpenApi.Core.DocumentHelper.<>c.<GetHttpTriggerMethods>b__3_4(MethodInfo p)
at System.Linq.Utilities.<>c__DisplayClass1_0`1.<CombinePredicates>b__0(TSource x)
at System.Linq.Enumerable.WhereEnumerableIterator`1.ToList()
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Microsoft.Azure.WebJobs.Extensions.OpenApi.Core.DocumentHelper.GetHttpTriggerMethods(Assembly assembly)
at Microsoft.Azure.WebJobs.Extensions.OpenApi.Core.Document.Build(Assembly assembly, OpenApiVersionType version)
at Microsoft.Azure.WebJobs.Extensions.OpenApi.OpenApiTriggerFunctionProvider.RenderOpenApiDocument(HttpRequest req, String version, String extension, ExecutionContext ctx, ILogger log)
Steps to reproduce:
- Create brand new Function App project in VS - .NET Core 3.1 / Function App v3
- Install OpenAPI Extension
- Run function app
- Open http://localhost:7071/api/openapi/1.0 in the web browser - it does work
- Install EF Core 3.1.6
- Run function app
- Open http://localhost:7071/api/openapi/1.0 in the web browser - returns an error
so EF Core 3.1.16 requires Microsoft.Extensions.Logging.Abstractions >= 3.1.16
It seems that the OpenAPI extension can work only when it is < 3.0.
Do you have any insight into it?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
Enriched Web API Documentation using Swagger/OpenAPI in ...
Search and select the "ASP.NET Core Web API" template and click "Next". Name the new project (e.g. as "TutorialWebApiDocumentation"), select the ...
Read more >Using OpenAPI with .NET Core
OpenAPI is a specification for describing RESTful APIs. First, I'll show you how to use OpenAPI to describe the APIs provided by an...
Read more >c# - services.AddSwaggerGen() giving error
I had problem, that. IServiceCollection does not contain a definition for 'AddSwaggerGen'. I turnes out, that I installed Swashbuckle.
Read more >Swagger OpenAPI Configurations in ASP.NET Core Web API
In this tutorial we learned about Swagger OpenAPI specification and how can we integrate our ASP.NET Core Web API to define and configure...
Read more >Get started with Swashbuckle and ASP.NET Core
Learn how to add Swashbuckle to your ASP.NET Core web API project to integrate the Swagger UI.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am guessing that the the above is a separate issue, where your
OpenApiSecurityAttribute
implementation lacks a parameterless constructor (see #168 for some more context).I’m facing the same issues, could it be related to #281?