Skip to content

[CSharp] Problems with code creation #7218

@karussell

Description

@karussell
Description

I have no windows here and so I tried to build the c# version of our client library under Ubuntu 16.04, but this fails with:

[INFO] Target framework: net45
[INFO] Download nuget and packages
File ‘nuget.exe’ already there; not retrieving.

Mozilla Roots Importer - version 5.4.1.6
Download and import trusted root certificates from Mozilla's MXR.
Copyright 2002, 2003 Motus Technologies. Copyright 2004-2008 Novell. BSD licensed.

WARNING: mozroots is deprecated, please move to cert-sync instead.

Downloading from 'https://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt'...
Importing certificates into user store...
1 new root certificates were added to your trust store.
Import process completed.

[INFO] Copy DLLs to the 'bin' folder
[INFO] Run 'mcs' to build bin/IO.Swagger.dll
warning CS8001: SDK path could not be resolved
src/IO.Swagger/Model/ResponseCoordinatesArray.cs(30,58): error CS0305: Using the generic type `System.Collections.Generic.List<T>' requires `1' type argument(s)
/usr/lib/mono/4.5/mscorlib.dll (Location of the symbol related to previous error)
src/IO.Swagger/Api/GeocodingApi.cs(128,29): error CS0104: `Configuration' is an ambiguous reference between `IO.Swagger.Client.Configuration' and `IO.Swagger.Model.Configuration'
src/IO.Swagger/Client/Configuration.cs(23,18): (Location of the symbol related to previous error)
src/IO.Swagger/Model/Configuration.cs(30,26): (Location of the symbol related to previous error)
src/IO.Swagger/Api/GeocodingApi.cs(167,16): error CS0104: `Configuration' is an ambiguous reference between `IO.Swagger.Client.Configuration' and `IO.Swagger.Model.Configuration'
src/IO.Swagger/Client/Configuration.cs(23,18): (Location of the symbol related to previous error)
src/IO.Swagger/Model/Configuration.cs(30,26): (Location of the symbol related to previous error)
src/IO.Swagger/Api/GeocodingApi.cs(167,16): error CS0104: `Configuration' is an ambiguous reference between `IO.Swagger.Client.Configuration' and `IO.Swagger.Model.Configuration'
src/IO.Swagger/Client/Configuration.cs(23,18): (Location of the symbol related to previous error)
src/IO.Swagger/Model/Configuration.cs(30,26): (Location of the symbol related to previous error)
src/IO.Swagger/Api/GeocodingApi.cs(167,16): error CS0104: `Configuration' is an ambiguous reference between `IO.Swagger.Client.Configuration' and `IO.Swagger.Model.Configuration'
src/IO.Swagger/Client/Configuration.cs(23,18): (Location of the symbol related to previous error)
src/IO.Swagger/Model/Configuration.cs(30,26): (Location of the symbol related to previous error)
src/IO.Swagger/Api/IsochroneApi.cs(128,29): error CS0104: `Configuration' is an ambiguous reference between `IO.Swagger.Client.Configuration' and `IO.Swagger.Model.Configuration'
src/IO.Swagger/Client/Configuration.cs(23,18): (Location of the symbol related to previous error)
src/IO.Swagger/Model/Configuration.cs(30,26): (Location of the symbol related to previous error)
src/IO.Swagger/Api/IsochroneApi.cs(167,16): error CS0104: `Configuration' is an ambiguous reference between `IO.Swagger.Client.Configuration' and `IO.Swagger.Model.Configuration'
src/IO.Swagger/Client/Configuration.cs(23,18): (Location of the symbol related to previous error)
src/IO.Swagger/Model/Configuration.cs(30,26): (Location of the symbol related to previous error)
src/IO.Swagger/Api/IsochroneApi.cs(167,16): error CS0104: `Configuration' is an ambiguous reference between `IO.Swagger.Client.Configuration' and `IO.Swagger.Model.Configuration'
src/IO.Swagger/Client/Configuration.cs(23,18): (Location of the symbol related to previous error)
src/IO.Swagger/Model/Configuration.cs(30,26): (Location of the symbol related to previous error)
src/IO.Swagger/Api/IsochroneApi.cs(167,16): error CS0104: `Configuration' is an ambiguous reference between `IO.Swagger.Client.Configuration' and `IO.Swagger.Model.Configuration'
src/IO.Swagger/Client/Configuration.cs(23,18): (Location of the symbol related to previous error)
src/IO.Swagger/Model/Configuration.cs(30,26): (Location of the symbol related to previous error)
src/IO.Swagger/Api/MatrixApi.cs(170,26): error CS0104: `Configuration' is an ambiguous reference between `IO.Swagger.Client.Configuration' and `IO.Swagger.Model.Configuration'
src/IO.Swagger/Client/Configuration.cs(23,18): (Location of the symbol related to previous error)
src/IO.Swagger/Model/Configuration.cs(30,26): (Location of the symbol related to previous error)
src/IO.Swagger/Api/MatrixApi.cs(209,16): error CS0104: `Configuration' is an ambiguous reference between `IO.Swagger.Client.Configuration' and `IO.Swagger.Model.Configuration'
src/IO.Swagger/Client/Configuration.cs(23,18): (Location of the symbol related to previous error)
src/IO.Swagger/Model/Configuration.cs(30,26): (Location of the symbol related to previous error)
src/IO.Swagger/Api/MatrixApi.cs(209,16): error CS0104: `Configuration' is an ambiguous reference between `IO.Swagger.Client.Configuration' and `IO.Swagger.Model.Configuration'
src/IO.Swagger/Client/Configuration.cs(23,18): (Location of the symbol related to previous error)
src/IO.Swagger/Model/Configuration.cs(30,26): (Location of the symbol related to previous error)
src/IO.Swagger/Api/MatrixApi.cs(209,16): error CS0104: `Configuration' is an ambiguous reference between `IO.Swagger.Client.Configuration' and `IO.Swagger.Model.Configuration'
src/IO.Swagger/Client/Configuration.cs(23,18): (Location of the symbol related to previous error)
src/IO.Swagger/Model/Configuration.cs(30,26): (Location of the symbol related to previous error)
src/IO.Swagger/Api/RoutingApi.cs(184,27): error CS0104: `Configuration' is an ambiguous reference between `IO.Swagger.Client.Configuration' and `IO.Swagger.Model.Configuration'
src/IO.Swagger/Client/Configuration.cs(23,18): (Location of the symbol related to previous error)
src/IO.Swagger/Model/Configuration.cs(30,26): (Location of the symbol related to previous error)
src/IO.Swagger/Api/RoutingApi.cs(223,16): error CS0104: `Configuration' is an ambiguous reference between `IO.Swagger.Client.Configuration' and `IO.Swagger.Model.Configuration'
src/IO.Swagger/Client/Configuration.cs(23,18): (Location of the symbol related to previous error)
src/IO.Swagger/Model/Configuration.cs(30,26): (Location of the symbol related to previous error)
src/IO.Swagger/Api/RoutingApi.cs(223,16): error CS0104: `Configuration' is an ambiguous reference between `IO.Swagger.Client.Configuration' and `IO.Swagger.Model.Configuration'
src/IO.Swagger/Client/Configuration.cs(23,18): (Location of the symbol related to previous error)
src/IO.Swagger/Model/Configuration.cs(30,26): (Location of the symbol related to previous error)
src/IO.Swagger/Api/RoutingApi.cs(223,16): error CS0104: `Configuration' is an ambiguous reference between `IO.Swagger.Client.Configuration' and `IO.Swagger.Model.Configuration'
src/IO.Swagger/Client/Configuration.cs(23,18): (Location of the symbol related to previous error)
src/IO.Swagger/Model/Configuration.cs(30,26): (Location of the symbol related to previous error)
src/IO.Swagger/Api/SolutionApi.cs(108,28): error CS0104: `Configuration' is an ambiguous reference between `IO.Swagger.Client.Configuration' and `IO.Swagger.Model.Configuration'
src/IO.Swagger/Client/Configuration.cs(23,18): (Location of the symbol related to previous error)
src/IO.Swagger/Model/Configuration.cs(30,26): (Location of the symbol related to previous error)
src/IO.Swagger/Api/SolutionApi.cs(147,16): error CS0104: `Configuration' is an ambiguous reference between `IO.Swagger.Client.Configuration' and `IO.Swagger.Model.Configuration'
src/IO.Swagger/Client/Configuration.cs(23,18): (Location of the symbol related to previous error)
src/IO.Swagger/Model/Configuration.cs(30,26): (Location of the symbol related to previous error)
src/IO.Swagger/Api/SolutionApi.cs(147,16): error CS0104: `Configuration' is an ambiguous reference between `IO.Swagger.Client.Configuration' and `IO.Swagger.Model.Configuration'
src/IO.Swagger/Client/Configuration.cs(23,18): (Location of the symbol related to previous error)
src/IO.Swagger/Model/Configuration.cs(30,26): (Location of the symbol related to previous error)
src/IO.Swagger/Api/SolutionApi.cs(147,16): error CS0104: `Configuration' is an ambiguous reference between `IO.Swagger.Client.Configuration' and `IO.Swagger.Model.Configuration'
src/IO.Swagger/Client/Configuration.cs(23,18): (Location of the symbol related to previous error)
src/IO.Swagger/Model/Configuration.cs(30,26): (Location of the symbol related to previous error)
src/IO.Swagger/Api/VrpApi.cs(108,23): error CS0104: `Configuration' is an ambiguous reference between `IO.Swagger.Client.Configuration' and `IO.Swagger.Model.Configuration'
src/IO.Swagger/Client/Configuration.cs(23,18): (Location of the symbol related to previous error)
src/IO.Swagger/Model/Configuration.cs(30,26): (Location of the symbol related to previous error)
src/IO.Swagger/Api/VrpApi.cs(147,16): error CS0104: `Configuration' is an ambiguous reference between `IO.Swagger.Client.Configuration' and `IO.Swagger.Model.Configuration'
src/IO.Swagger/Client/Configuration.cs(23,18): (Location of the symbol related to previous error)
src/IO.Swagger/Model/Configuration.cs(30,26): (Location of the symbol related to previous error)
src/IO.Swagger/Api/VrpApi.cs(147,16): error CS0104: `Configuration' is an ambiguous reference between `IO.Swagger.Client.Configuration' and `IO.Swagger.Model.Configuration'
src/IO.Swagger/Client/Configuration.cs(23,18): (Location of the symbol related to previous error)
src/IO.Swagger/Model/Configuration.cs(30,26): (Location of the symbol related to previous error)
src/IO.Swagger/Api/VrpApi.cs(147,16): error CS0104: `Configuration' is an ambiguous reference between `IO.Swagger.Client.Configuration' and `IO.Swagger.Model.Configuration'
src/IO.Swagger/Client/Configuration.cs(23,18): (Location of the symbol related to previous error)
src/IO.Swagger/Model/Configuration.cs(30,26): (Location of the symbol related to previous error)
src/IO.Swagger/Model/ResponseCoordinatesArray.cs(56,28): warning CS0109: The member `IO.Swagger.Model.ResponseCoordinatesArray.ToJson()' does not hide an inherited member. The new keyword is not required
src/IO.Swagger/Model/ResponseInstructions.cs(56,28): warning CS0109: The member `IO.Swagger.Model.ResponseInstructions.ToJson()' does not hide an inherited member. The new keyword is not required
Compilation failed: 25 error(s), 3 warnings
[ERROR] Compilation failed with exit code 0

BTW: Changing the sdk option to just 4.5 removes also the warning "warning CS8001: SDK path could not be resolved". So I do not think that is the root cause.
BTW2: the same problems seems to persist with C# 5 under windows as someone else reported to me in a personal email.

Swagger-codegen version

2.2.3 or master from 14 Nov

Swagger declaration file content or url

https://github.com/graphhopper/directions-api-clients/blob/master/swagger.json

Command line used for generation

java -jar swagger.jar generate -i swagger.json -l csharp --artifact-version 0.10-SNAPSHOT --git-repo-id directions-api-client --git-user-id graphhopper --api-package directions-api-client -o csharp"

Steps to reproduce

install mono on Ubuntu 16.04 via

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/mono-official.list
sudo apt-get update
sudo apt install mono-complete

then do

git clone https://github.com/graphhopper/directions-api-clients
cd  directions-api-clients/csharp
bash build.sh
Related issues/PRs

Nothing found

Suggest a fix/enhancement

No idea

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions