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

Is .NET 8 SDK Required? #1013

Open
carminoplata opened this issue Oct 9, 2024 · 4 comments
Open

Is .NET 8 SDK Required? #1013

carminoplata opened this issue Oct 9, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@carminoplata
Copy link

Hi,

I'm dealing with this error when I try to generate code from swagger.json Impossible load file or assembly System.Text.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51.

Do I need to download and use SDK .NET 8?

Support Key: 9ca55a7 Found in Tools -> Options -> REST API Client Code Generator - Analytics

To Reproduce
Using only .NET 7 SDK and ASP.NET Core Runtime 8.0.10, Install REST API Client Code Generator for VS 2022

@christianhelle christianhelle self-assigned this Oct 9, 2024
@christianhelle christianhelle added the bug Something isn't working label Oct 9, 2024
@christianhelle
Copy link
Owner

@carminoplata Thanks for taking the time to report this.

This is probably a bug that was introduced recently. The System.Text.Json version needs to be aligned with what Refitter, NSwag, and this Visual Studio extension uses. I remember merging a couple of Dependabot pull requests for System.Text.Json due to Microsoft Security Advisory CVE-2024-43485 which was most likely the cause of this

I'll fix this as soon as I can

@christianhelle
Copy link
Owner

@carminoplata I just did some testing on the current released version (v1.14.0) and I can't seem to reproduce your error. Do you know what version of this extension you are using? Maybe upgrading to the latest version would help.

I tried out the latest version (v1.14.0) on the latest Visual Studio 2022 (v17.12.0 )

@christianhelle
Copy link
Owner

Do I need to download and use SDK .NET 8?

No, you don't need .NET 8 to run the extension. For historical reasons, Visual Studio extensions are written using .NET Framework 4.8.

Also, as far as I know, the .NET 8.0 SDK comes with Visual Studio 2022

@carminoplata
Copy link
Author

@carminoplata I just did some testing on the current released version (v1.14.0) and I can't seem to reproduce your error. Do you know what version of this extension you are using? Maybe upgrading to the latest version would help.

I tried out the latest version (v1.14.0) on the latest Visual Studio 2022 (v17.12.0 )
I'm using latest version 1.14.0 and Visual Studio 2022 (v17.7.6)

In addition, I'm dealing with this error when I try to generate Client using Refitter from a swagger generated via nswag studio. Using Generate with NSwag (14.1.0), I don't have any issue except for the multiple delcarations of the same _httpClient into multiple interfaces and partial classes inside the generated Client.cs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants
@christianhelle @carminoplata and others