Closed Berthelmaster closed 7 months ago
I feel like there's a larger question here. This repo hasn't seen a commit for 9 months and .NET 8 is a month away. @domaindrivendev, can you provide some insight into the near-term plans for Swashbuckle and also .NET 8?
I was able to get the CLI to run successfully targeting net8.0
using the .Net 8 rc-2 SDK. swashbuckle.aspnetcore.cli
was upgraded for version 6.5.0; it failed when the CLI was version 6.3.1.
However, I am now seeing an issue similar to @Berthelmaster when I target net6.0
(existing apps), and use the CLI, regardless of version.
Error: " Unhandled exception. System.IO.FileLoadException: Could not load file or assembly 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (0x80131040) File name: 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'"
It also seems to ignore the global.json
file which I used to downgrade the SDK to version 6.0.414. It is still using the .Net 8 rc-2 SDK and fails accordingly because it is not being used for that build.
global.json
{
"sdk": {
"version": "6.0.414"
}
}
Error:
"C:\Program Files\dotnet\sdk\8.0.100-rc.2.23502.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.Shared.targets(80,5): error MSB4062: The "CheckIfPackageReferenceShouldBeFrameworkReferen
ce" task could not be loaded from the assembly C:\Program Files\dotnet\sdk\8.0.100-rc.2.23502.2\Sdks\Microsoft.NET.Sdk\targets..\tools\net8.0\Microsoft.NET.Build.Tasks.dll. Could not load file or ass
embly 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. Confirm that the
Package "swashbuckle.aspnetcore.cli" failed to restore, due to Microsoft.DotNet.ToolPackage.ToolPackageException: The tool package could not be restored. at Microsoft.DotNet.Tools.Tool.Install.ProjectRestorer.Restore(FilePath project, PackageLocation packageLocation, String verbosity) at Microsoft.DotNet.ToolPackage.ToolPackageInstaller.InstallPackageToExternalManagedLocation(PackageLocation packageLocation, PackageId packageId, VersionRange versionRange, String targetFramewor k, String verbosity) at Microsoft.DotNet.Tools.Tool.Restore.ToolRestoreCommand.InstallPackages(ToolManifestPackage package, Nullable`1 configFile)
Restore failed. "
Please advise on the availability of a new package with backwards compatibility.
I'm getting a little bit worried, we scheduled to upgrade to dotnet 8 next month, anybody has heard from @domaindrivendev? @theonesuperdaveXTR @psiservices-dbrink what do you plan to do? We're considering migrating away from Swashbuckle :(
Swashbuckle works just fine at runtime, having used it in many projects for years. If you cannot get its CLI to work, then you might go with that option.
I did get version 6.5.0 of the CLI to work and generate both YAML and JSON files while my app was targeting net8.0
. This was using the .Net 8 RC2 SDK.
You might also try the global.json
file to downgrade the SDK, just to see if anything will work for you. Hope that helps!
@Berthelmaster, I'm still evaluating the situation. The build had been broken for a bit and I just opened a PR to fix it late last week. It was the first good build since August and I hope it will trigger some activity.
Are you looking at NSwag as an alternative?
@psiservices-dbrink Yes we do! We use it already for api client generation, so that was also our goto, I have no tried using it to generate swagger files though
I encountered the same problem and used this workaround. Simply set the environment variable DOTNET_ROLL_FORWARD=LatestMajor
I haven't observed any issues related to the workaround so far.
I have also hit an issue trying to run the CLI with the recently released .NET 8 SDK
It looks like @domaindrivendev has abondoned Swashbuckle. I checked his LinkedIn profile to check if he has left Unsplash, but according to his profile he is still working there. I can imagine that focus shifts to another project, but it would be nice to have a statement from him, so either the community can take over or he may resume the development.
By now 8.0.0 has landed and the problem persists.
You must install or update .NET to run this application.
App: /home/benni/.nuget/packages/swashbuckle.aspnetcore.cli/6.5.0/tools/net7.0/any/dotnet-swagger.dll
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '7.0.0' (x64)
.NET location: /usr/share/dotnet/
The following frameworks were found:
8.0.0 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Learn more:
https://aka.ms/dotnet/app-launch-failed
To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=7.0.0&arch=x64&rid=linux-x64&os=ubuntu.22.04
Given the lack of other contributions on github, I hope he is alright. Given the lack of alternatives to swashbuckle, this is a rather big problem for the asp.net ecosystem :(
By now 8.0.0 has landed and the problem persists.
You must install or update .NET to run this application. App: /home/benni/.nuget/packages/swashbuckle.aspnetcore.cli/6.5.0/tools/net7.0/any/dotnet-swagger.dll Architecture: x64 Framework: 'Microsoft.NETCore.App', version '7.0.0' (x64) .NET location: /usr/share/dotnet/ The following frameworks were found: 8.0.0 at [/usr/share/dotnet/shared/Microsoft.NETCore.App] Learn more: https://aka.ms/dotnet/app-launch-failed To install missing framework, download: https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=7.0.0&arch=x64&rid=linux-x64&os=ubuntu.22.04
Given the lack of other contributions on github, I hope he is alright. Given the lack of alternatives to swashbuckle, this is a rather big problem for the asp.net ecosystem :(
The main alternative right now would be https://github.com/RicoSuter/NSwag
ITNOA
related to #2707
related to #2759
I have created a fork called DotSwashbuckle for .NET 8 and forward, it fixes some long lasting issues.
Ahh too late, we already switched all our applications to Nswag 😅
We have a number of issues open that are related to adding support for .NET 8, which we plan to do in a future release in the near future.
I'm going to close this in favour of #2792, as going through triaging the open issues I'm spotting a common theme and it's easier to manage one issue. Please track that issue for further updates.
If this issue isn't resolved once we have added support for net8.0
, please open a new issue.
Hi!
We really appreciate your package, we're currently upgrading our stuff to dotnet rc2 and we get the following error:
Could it be possible to create a beta package that targets .NET 8?
We really appreciate it!