Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swagger UI breaks with Microsoft.Extensions.Logging.Abstractions 3.1.x #281

Closed
lahsrah opened this issue Oct 13, 2021 · 1 comment
Closed
Labels
question Further information is requested resolved Request has been resolved wontfix This will not be worked on

Comments

@lahsrah
Copy link

lahsrah commented Oct 13, 2021

Describe the issue
Swagger UI works fine without Microsoft.Extensions.Logging.Abstractions 3.1.x but as soon as you need a package that depends on this, Swagger UI breaks with this error:

[2021-10-13T21:27:22.743Z] Executing 'Functions.RenderSwaggerUI' (Reason='This function was programmatically called via the host APIs.', Id=8f9c9178-c476-4b1e-8809-ff4c74d74ad5)
[2021-10-13T21:27:22.751Z] SwaggerUI page was requested.
[2021-10-13T21:27:22.830Z] Executed 'Functions.RenderSwaggerUI' (Succeeded, Id=8f9c9178-c476-4b1e-8809-ff4c74d74ad5, Duration=102ms)
[2021-10-13T21:27:23.012Z] Executing 'Functions.RenderSwaggerDocument' (Reason='This function was programmatically called via the host APIs.', Id=c8482795-88c8-46cc-a08e-a6414578a812)
[2021-10-13T21:27:23.015Z] swagger.json was requested.
[2021-10-13T21:27:23.026Z] Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions, Version=3.1.20.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
[2021-10-13T21:27:23.078Z] Executed 'Functions.RenderSwaggerDocument' (Succeeded, Id=c8482795-88c8-46cc-a08e-a6414578a812, Duration=70ms)
[2021-10-13T21:27:25.339Z] Host lock lease acquired by instance ID '000000000000000000000000A1B8A49E'.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new Azure Functions project with .NET Core 3.1 LTS and select HTTP function with OpenAPI template
  2. Compile and run the project and verify that Swagger UI works
  3. Use Nuget package manager to install Microsoft.Extensions.Logging.Abstractions 3.1.20
  4. Recompile and run project and try to browse Swagger UI

Expected behavior
Swagger UI should work as per before

Screenshots
image

Environment (please complete the following information, if applicable):

  • OS: Windows 10
  • Framework: .NET Core 3.1 LTS
  • Browser: Edge / Chrome
  • Version: Any version

Source code
https://github.com/lahsrah/FunctionAppWithOpenApi

@justinyoo
Copy link
Contributor

This is the known issue on the Azure Functions runtime. Azure/azure-functions-vs-build-sdk#397 (comment)

Here's the workaround:

  <PropertyGroup>
    ...
    <_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
  </PropertyGroup>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested resolved Request has been resolved wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants