CSharp
Description
The CSharpNet2 client does not work with dotnet core 2.0.
Swagger-codegen version
2.3.0-SNAPSHOT
Steps to reproduce
The generated code has a dependency on RestSharp.Net2 1.1.11, which in turn has a dependency on a 4.6.1 framework dependency (Newtonsoft.Json 4.5.1).
Given this, the CSharpNet2 package cannot be referenced via nuget in a dotnetcore 2.0 project.
Suggest a fix/enhancement
One possible fix would be that the generated code could instead depend upon RestSharp.NetCore 105.2.3
@sheltonc instead of using csharp-dotnet2, what about using csharp to generate C# API client instead?
@wing328 I've also tried this, to the same effect.
Package 'RestSharp 105.1.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your project.
Are there any plans to implement a client compatible with NETCoreApp0 2.0?
@sheltonc Did you try a different targetFramework (e.g. v5.0)?
targetFramework
The target .NET framework version. (Default: v4.5)
v3.5 - .NET Framework 3.5 compatible
v4.5 - .NET Framework 4.5+ compatible
v5.0 - .NET Standard 1.3 compatible
uwp - Universal Windows Platform (IMPORTANT: this will be decommissioned and replaced by v5.0)
Ref: java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help -l csharp
Also worth showing you the following option:
netCoreProjectFile
Use the new format (.NET Core) for .NET project files (.csproj). (Default: false)
That was exactly what was needed. Thanks!
@sheltonc np. let us know if you've more question.
Hi @wing328, hi @sheltonc ,
I'm also running on the same problematic. However I was not able to follow on the solution. I'm all new to the topic. Could you please describe more in detail what you did to solve this? Thanks.
I'm also running on the same problematic. However I was not able to follow on the solution. I'm all new to the topic. Could you please describe more in detail what you did to solve this? Thanks.