Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions when loading swagger.json

onlyutkarsh 6 Reputation points MVP
2021-09-16T20:16:37.24+00:00

Hello, I am on v3.x assemblies and trying to load swagger.json. However I am getting

Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions, Version=3.1.19.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.Extensions.DocumentHelperExtensions.<>c.<GetHttpTriggerMethods>b__0_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.Extensions.DocumentHelperExtensions.GetHttpTriggerMethods(IDocumentHelper helper, Assembly assembly)
   at Microsoft.Azure.WebJobs.Extensions.OpenApi.Document.Build(Assembly assembly, OpenApiVersionType version)
   at Microsoft.Azure.WebJobs.Extensions.OpenApi.OpenApiTriggerFunctionProvider.RenderSwaggerDocument(HttpRequest req, String extension, ExecutionContext ctx, ILogger log)

The code is available here - https://github.com/onlyutkarsh/FSharpSwaggerProviderDemo and name of the Function project is FSSwaggerProviderDemo.MyWeatherApi

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,930 questions
Developer technologies | C#
{count} vote

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.