Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET Standard support? #3

Closed
Res42 opened this issue May 19, 2019 · 9 comments
Closed

.NET Standard support? #3

Res42 opened this issue May 19, 2019 · 9 comments

Comments

@Res42
Copy link

Res42 commented May 19, 2019

Currently this library only supports .NET Framework 4.5 according to the .csproj file.

This library is generated with swagger-codegen-cli 2.4.4. There is a switch in the generator command to change the target framework like this: swagger-codegen generate [...] --additional-properties targetFramework=v5.0. This will then generate a .NET Standard 1.3 client.

As the generator script is not publicized I cannot rerun the generator with this added configuration option. Could you please publicize the generator script or regenerate the client with this option?

Note: this change will also replace the RestSharp 105.1.0 package with these two: FubarCoder.RestSharp.Portable.Core 4.0.7 and FubarCoder.RestSharp.Portable.HttpClient 4.0.7. So this line in the readme may be removed:

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742

@Mikelsoft99
Copy link

Mikelsoft99 commented Jun 14, 2019

hey,
this is very simple porting it to the netstandard2.0.
Changing the targetFramework in the project settings and installing the NuGet package
System.ComponentModel.Annotations

Problem solved!

Best regards
Mike

--- UPDATE
sorry that's not going to work. On my production server came up some errors!!!

@Res42
Copy link
Author

Res42 commented Jun 14, 2019

Hello!

In the end we did this too. But I would have liked it more if there was official support and a nuget package.

I'll include the .csproj that worked for us. Also we updated the dependencies.

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    <!-- Not relevant configs. -->
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="JsonSubTypes" Version="1.5.2" />
    <PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
    <PackageReference Include="RestSharp" Version="106.6.9" />
    <PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
    <PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
    <PackageReference Include="System.Dynamic.Runtime" Version="4.3.0" />
  </ItemGroup>

</Project>

@Mikelsoft99
Copy link

Hi, that's sounds strange to me.
I get an exception when the configuration class is created . TypeinitializationException. could not fix this problem, and had to switch over the the net45 framework, as it was in the beginning.

Lucky you if it worked. The piple on azure reported an error in compiling and I had to switch back.

@Res42
Copy link
Author

Res42 commented Jun 14, 2019

We didn't encounter this compilation error nor the exception. But we only use SMTPApi.SendTransacEmailAsyncWithHttpInfo().

@mbrookson
Copy link

+1 for getting this officially ported to .NET Standard

@mbrookson
Copy link

Hi @amitsendinblue, is there any update on when .netstandard will be officially supported? I have deployed a project using the existing package to a Linux environment and run locally on a Mac and it seems to work as expected.

Would be great to see this project maintained properly. Thanks!

@amitsendinblue
Copy link
Collaborator

Hi @Res42, @Mikelsoft99 , @mbrookson , I have incorporated suggested changes to the following branch, could you please check at you end if these changes are working fine for you. In either case please let me know.

https://github.com/sendinblue/APIv3-csharp-library/tree/UpdateWrapper

Thank you

@Res42
Copy link
Author

Res42 commented Jan 14, 2020

Hello, I don't work on the project which used this anymore, but I will forward this issue to my colleagues.

@amitsendinblue
Copy link
Collaborator

Hi @Res42, Thanks for the reply. I have merged the above mentioned branch into master:- https://github.com/sendinblue/APIv3-csharp-library

Also updated the nuget package for the same :- https://www.nuget.org/packages/sib_api_v3_sdk/

As the issue is resolved now, I am closing this issue.
Thanks,
Amit Joshi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants