Skip to content

[BUG] [csharp] client always generated under targetFramework net45 #4202

Closed
@PeterTriebe

Description

@PeterTriebe

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator
  • What's the version of OpenAPI Generator used? - 4.1.3
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output? actual: <TargetFramework>net45</TargetFramework> expected: <TargetFramework>netstandard2.0</TargetFramework>
Description

open-api generates the client always as <TargetFramework>net45</TargetFramework>
Its a bug inside the generator. We always set targetFramework=netstandard2.0 but its not working.

openapi-generator version

4.1.3

OpenAPI declaration file content or url
Command line used for generation

example usage: java -jar "openapi-generator-cli-4.1.3.jar" generate -i api.yaml -g csharp -o Example.Client -p targetFramework=netstandard2.0 -p netCoreProjectFile=true -p packageName=Example.Client

Steps to reproduce

use the command line and generate the client. After generating check the csproj file. Inside there is a tag "TargetFramework"

Related issues/PRs

I think old fixed bugs like #3691 produces this new bug

Suggest a fix

I think targetFramework=netstandard2.0 is ignored if netCoreProjectFile=true.
If netCoreProjectFile=false the project is set to netstandard2.0. But netstandard2.0 needs the new netCore Project Format to work.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions