christianhelle / apiclientcodegen

A collection of Visual Studio custom tool code generators for Swagger / OpenAPI specification files
http://bit.ly/restapicodegen
GNU General Public License v3.0
177 stars 23 forks source link

Unable to install Microsoft.CSharp version 4.5.0 #1006

Open benjavalero opened 3 weeks ago

benjavalero commented 3 weeks ago

The OpenApi generation fails at the moment of installing the necessary dependencies, in particular when trying to install the package Microsoft.CSharp:

Unable to install Microsoft.CSharp version 4.5.0

This happens because my project already contains a dependency which depends on a higher version. In particular:

<PackageReference Include="AutoMapper" Version="10.1.1" />

depends on:

<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />

I wonder if it would be possible not trying to install a package if it already exists with a higher version.

christianhelle commented 3 weeks ago

@benjavalero thanks for taking the time to report this

I hadn't thought much about transitive dependencies when I built the feature, and I mostly test and verify this on empty projects.

I'll see what I can do.

As a workaround, you can disable Automatically install missing NuGet packages until I figure out a better solution image