Open MitchellW-DWL opened 1 week ago
@martincostello Here's your new issue 👍
Please provide a minimal reproducible example as a GitHub repository that demonstrates the issue you're experiencing so we can look into this further.
Support for Minimal APIs has been working in general for others, so I feel that this issue is something specific to how your project is set up (given how the exception isn't coming from our code).
We need something we can actually debug to look into to get towards any kind of resolution.
As a starting point, using the latest version will be a step forward you'll need as versions since 6.7.0 target net8.0
and also contain other bug fixes related to the CLI.
Support for Minimal APIs has been working in general for others, so I feel that this issue is something specific to how your project is set up (given how the exception isn't coming from our code).
Yeah this project doesn't use the minimal hosting - I'll try to find some time to replicate the issue but given it's intermittent it might be a struggle as the last instance I setup worked with no differences I could discern
Describe the bug
Have been following https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/2168 and have tried all the described solutions there, running locally this works fine, running in PR checks it works fine, but then when running a deploy this breaks.
I'm on .net8 using swashbuckle 6.5.0 (Have tried with original version 6.2.3 and newest 6.8.0 too) it seemed to happen somewhat intermittently in the past but retrying the workflow would eventually get it through however now it's failing continuously.
`dotnet-tools.json`
```json { "version": 1, "isRoot": true, "tools": { "swashbuckle.aspnetcore.cli": { "version": "6.5.0", "commands": [ "swagger" ] } } } ```
csproj
```xml
net8.0
enable
enable
```
Action build step
```yml - name: 🔨 Build run: dotnet build --no-restore -c Release env: API_IMPORT_DLL: 'Speechy/Speechy/Speechy.WebApi/bin/Release/net8.0/Speechy.WebApi.dll' SWASHBUCKLE_ASPNET_CORE_CLI_PACKAGE_VERSION: 6.5.0 API_IMPORT_VERSION: v1 CONFIGURATION: Release ```
Only difference between the PR check that works building the project and generating swagger json that I can discern is one is production, other is not but building in production locally works fine.
Expected behavior
Get a swagger openapi json spec
Actual behavior
Exception thrown
Steps to reproduce
No response
Exception(s) (if any)
Swashbuckle.AspNetCore version
6.2.3, 6.4.0, 6.5.0, 6.8.0
.NET Version
.net8.0
Anything else?
Have been looking at all the following https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/2168 Tried having a blank
appsettings.Production.json
file but still threw same error along with the different suggested versionsHave followed https://stackoverflow.com/questions/78406014/system-invalidoperationexception-a-type-named-startupproduction-or-startup Trying the suggest env vars for the step, but inclusion of them didnt seem to work and confirmed the file path is correct (Worth noting I only tried adding these after it started failing as didnt need them before that point)
Please let me know if there's anything else I can provide