[BUG] csharp-refactor generated client doesn't build in .net core but works with csharp generator
Created by: chrisdrobison
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
Generated a client using csharp-refactor and it doesn't build in .NET Core. Getting following errors:
Microsoft (R) Build Engine version 15.8.166+gd4e8d81a88 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restoring packages for /Users/i52017/dev/openapi-gen/output/src/Org.OpenAPITools/Org.OpenAPITools.csproj...
Installing Newtonsoft.Json 12.0.1.
Installing JsonSubTypes 1.5.1.
Generating MSBuild file /Users/i52017/dev/openapi-gen/output/src/Org.OpenAPITools/obj/Org.OpenAPITools.csproj.nuget.g.props.
Generating MSBuild file /Users/i52017/dev/openapi-gen/output/src/Org.OpenAPITools/obj/Org.OpenAPITools.csproj.nuget.g.targets.
Restore completed in 3.26 sec for /Users/i52017/dev/openapi-gen/output/src/Org.OpenAPITools/Org.OpenAPITools.csproj.
Api/ActivitiesApi.cs(17,18): error CS0234: The type or namespace name 'Mime' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) [/Users/i52017/dev/openapi-gen/output/src/Org.OpenAPITools/Org.OpenAPITools.csproj]
Api/CalculationsApi.cs(17,18): error CS0234: The type or namespace name 'Mime' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) [/Users/i52017/dev/openapi-gen/output/src/Org.OpenAPITools/Org.OpenAPITools.csproj]
Api/CategoriesApi.cs(17,18): error CS0234: The type or namespace name 'Mime' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) [/Users/i52017/dev/openapi-gen/output/src/Org.OpenAPITools/Org.OpenAPITools.csproj]
Api/CountriesApi.cs(17,18): error CS0234: The type or namespace name 'Mime' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) [/Users/i52017/dev/openapi-gen/output/src/Org.OpenAPITools/Org.OpenAPITools.csproj]
Api/HealthCheckApi.cs(17,18): error CS0234: The type or namespace name 'Mime' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) [/Users/i52017/dev/openapi-gen/output/src/Org.OpenAPITools/Org.OpenAPITools.csproj]
Api/ImportsApi.cs(17,18): error CS0234: The type or namespace name 'Mime' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) [/Users/i52017/dev/openapi-gen/output/src/Org.OpenAPITools/Org.OpenAPITools.csproj]
Api/ItemsApi.cs(17,18): error CS0234: The type or namespace name 'Mime' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) [/Users/i52017/dev/openapi-gen/output/src/Org.OpenAPITools/Org.OpenAPITools.csproj]
Api/ItemSelectorsApi.cs(17,18): error CS0234: The type or namespace name 'Mime' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) [/Users/i52017/dev/openapi-gen/output/src/Org.OpenAPITools/Org.OpenAPITools.csproj]
Api/PriceListsApi.cs(17,18): error CS0234: The type or namespace name 'Mime' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) [/Users/i52017/dev/openapi-gen/output/src/Org.OpenAPITools/Org.OpenAPITools.csproj]
Client/ApiClient.cs(35,48): error CS0234: The type or namespace name 'Serializers' does not exist in the namespace 'RestSharp' (are you missing an assembly reference?) [/Users/i52017/dev/openapi-gen/output/src/Org.OpenAPITools/Org.OpenAPITools.csproj]
Client/ApiClient.cs(35,83): error CS0234: The type or namespace name 'Deserializers' does not exist in the namespace 'RestSharp' (are you missing an assembly reference?) [/Users/i52017/dev/openapi-gen/output/src/Org.OpenAPITools/Org.OpenAPITools.csproj]
Build FAILED.
Api/ActivitiesApi.cs(17,18): error CS0234: The type or namespace name 'Mime' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) [/Users/i52017/dev/openapi-gen/output/src/Org.OpenAPITools/Org.OpenAPITools.csproj]
Api/CalculationsApi.cs(17,18): error CS0234: The type or namespace name 'Mime' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) [/Users/i52017/dev/openapi-gen/output/src/Org.OpenAPITools/Org.OpenAPITools.csproj]
Api/CategoriesApi.cs(17,18): error CS0234: The type or namespace name 'Mime' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) [/Users/i52017/dev/openapi-gen/output/src/Org.OpenAPITools/Org.OpenAPITools.csproj]
Api/CountriesApi.cs(17,18): error CS0234: The type or namespace name 'Mime' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) [/Users/i52017/dev/openapi-gen/output/src/Org.OpenAPITools/Org.OpenAPITools.csproj]
Api/HealthCheckApi.cs(17,18): error CS0234: The type or namespace name 'Mime' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) [/Users/i52017/dev/openapi-gen/output/src/Org.OpenAPITools/Org.OpenAPITools.csproj]
Api/ImportsApi.cs(17,18): error CS0234: The type or namespace name 'Mime' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) [/Users/i52017/dev/openapi-gen/output/src/Org.OpenAPITools/Org.OpenAPITools.csproj]
Api/ItemsApi.cs(17,18): error CS0234: The type or namespace name 'Mime' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) [/Users/i52017/dev/openapi-gen/output/src/Org.OpenAPITools/Org.OpenAPITools.csproj]
Api/ItemSelectorsApi.cs(17,18): error CS0234: The type or namespace name 'Mime' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) [/Users/i52017/dev/openapi-gen/output/src/Org.OpenAPITools/Org.OpenAPITools.csproj]
Api/PriceListsApi.cs(17,18): error CS0234: The type or namespace name 'Mime' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) [/Users/i52017/dev/openapi-gen/output/src/Org.OpenAPITools/Org.OpenAPITools.csproj]
Client/ApiClient.cs(35,48): error CS0234: The type or namespace name 'Serializers' does not exist in the namespace 'RestSharp' (are you missing an assembly reference?) [/Users/i52017/dev/openapi-gen/output/src/Org.OpenAPITools/Org.OpenAPITools.csproj]
Client/ApiClient.cs(35,83): error CS0234: The type or namespace name 'Deserializers' does not exist in the namespace 'RestSharp' (are you missing an assembly reference?) [/Users/i52017/dev/openapi-gen/output/src/Org.OpenAPITools/Org.OpenAPITools.csproj]
0 Warning(s)
11 Error(s)
Time Elapsed 00:00:04.35
openapi-generator version
4.0.0-beta
OpenAPI declaration file content or url
https://api.xactprm.com/pricing/swagger/current/swagger.json
Command line used for generation
openapi-generator generate -i swagger.json -g csharp-refactor -c config.json -o output
Config file:
{
"targetFramework": "v5.0",
"netCoreProjectFile": true
}
Steps to reproduce
- Generate code
cd output
dotnet build