Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #3687
Closed
Open
Issue created Aug 19, 2019 by Administrator@rootContributor5 of 6 checklist items completed5/6 checklist items

[BUG][csharp-netcore] Unexpected ItemGroup with references in csproj file

Created by: 414004738

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

When generating a client using the csharp-netcore generator with a targetFramework of netcoreapp2.0, there is an unexpected ItemGroup in the generated csproj file:

  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="System.ComponentModel.DataAnnotations" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Runtime.Serialization" />
    <Reference Include="System.Xml" />
  </ItemGroup>

It doesn't seem like the references in this ItemGroup are necessary, and seem to be generating a warning on compilation:

Microsoft.Common.CurrentVersion.targets(2110, 5): [MSB3245] Could not resolve this reference. Could not locate the assembly "System.Data.DataSetExtensions". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

If this entire ItemGroup is removed, the code compiles successfully and this warning is not generated.

openapi-generator version

4.1.0

OpenAPI declaration file content or url

I used the test yaml here: https://github.com/OpenAPITools/openapi-generator/blob/v4.1.0/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml

Command line used for generation

openapi-generator generate -g csharp-netcore -i ./petstore-with-fake-endpoints-models-for-testing.yaml --additional-properties targetFramework=netcoreapp2.0 -o ./netcoreapp2.0

Steps to reproduce

Run the command line above and look at the generated Org.OpenAPITools.csproj file. Build the project to see the compilation warning.

Related issues/PRs
Suggest a fix
Assignee
Assign to
Time tracking