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

Refit dependency is added when the dependency is already met in a Transient package reference #941

Open
dammitjanet opened this issue Jun 17, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@dammitjanet
Copy link

Describe the bug
I have a project where I already have Refit 7.0.0 as a transient package reference from including Refit.HttpClientFactory (although almost nay other package or project could theoretically also bring Refit into the transient dependency list), but every time I regenerate the code from the .refitter file, Refit is re-added and there is no need to.

Support Key: ecbee24

To Reproduce
Steps to reproduce the behavior:

  1. Create a project
  2. Add Refit.HttpClientFactory as a package reference
  3. Add a refitter file and generate
  4. remove the Refit 7.0.0 package reference
  5. Right click the .refitter file and 'Generate Refitter output'

Expected behavior
The tool to recognise that the Refit dependency is already met and not add it explicitly

Screenshots
n/a

Visual Studio Extension (please complete the following information):

  • Visual Studio Version: 2022, 17.10.2
  • REST API Client Code Generator: 1.10.3

Additional context
This is quite a low priority issue, but I expect it can also happen with any of the other code generators not just Refit.

@christianhelle christianhelle self-assigned this Jun 18, 2024
@christianhelle christianhelle added the enhancement New feature or request label Jun 18, 2024
@christianhelle
Copy link
Owner

@dammitjanet thanks for taking the time to report this. I'll see what I can do

@christianhelle
Copy link
Owner

christianhelle commented Jun 24, 2024

@dammitjanet I unfortunately completely forgot about this. For now, you can disable the feature Automatically installing missing NuGet packages under the Tools -> Options -> REST API Client Code Generator

image

I'm considering removing the NuGet-related features in my extension as the dependencies required for NuGet integration rely on ancient Visual Studio COM libraries, preventing me from making a single VSIX package that supports multiple versions of Visual Studio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants