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

New version of RestSharp #32

Closed
tomaszlis86 opened this issue Mar 15, 2023 · 4 comments
Closed

New version of RestSharp #32

tomaszlis86 opened this issue Mar 15, 2023 · 4 comments
Assignees

Comments

@tomaszlis86
Copy link

On 13.03.2023 was released new version of RestSharp (109.0.1) with changes to the RestClient and RestClientOptions.
This results in errors in ProxyHTTP.cs.
In lines 60, 101 - BuildUri method is no longer public on RestClient.
In line 145 - Authenticator has been moved from RestClient to RestClientOptions.

As for BuildUri there is discussion going, however as I see, it probably won't be accessible if only used for logging purposes.
restsharp/RestSharp#2026

@mpawikowski
Copy link
Collaborator

Hello,

Thank you for your report, I forwarded it to our IT department.

Best regards,
Mateusz Pawikowski

@mpawikowski mpawikowski reopened this Mar 15, 2023
@jakublabno jakublabno self-assigned this Mar 15, 2023
@jakublabno
Copy link
Collaborator

@tomaszlis86 They've restored this in version 110, however I don't know if the world is ready to abandon our support for .net 5 - new version of RestSharp requires .net >=6.
Maybe I'll find some workaround.

@tomaszlis86
Copy link
Author

Well, if you ever decide to push to newer version of RestSharp, I have discovered some issues with that as well.
Currently on version 110.2.0, there is a problem with reading from a stream on response. More or less, it is already closed.
Below you have the exception I am getting. I think it is somehow connected with this bug on RestSharp side:
restsharp/RestSharp#1822

"Message":"Failed to get response from https://smsapi.io/sms.do","Data":{},"InnerException":{"ClassName":"System.ObjectDisposedException","Message":"Cannot access a closed Stream.","Data":null,"InnerException":null,"HelpURL":null,"StackTraceString":" at System.IO.MemoryStream.Read(Byte[] buffer, Int32 offset, Int32 count)\n at System.IO.MemoryStream.ReadAsync(Memory1 buffer, CancellationToken cancellationToken)\n--- End of stack trace from previous location ---\n at RestSharp.Extensions.StreamExtensions.ReadAsBytes(Stream input, CancellationToken cancellationToken)\n at RestSharp.RestResponse.<>c__DisplayClass0_0.<<FromHttpResponse>g__GetDefaultResponse|0>d.MoveNext()\n--- End of stack trace from previous location ---\n at RestSharp.RestResponse.<>c__DisplayClass0_0.<<FromHttpResponse>g__GetDefaultResponse|0>d.MoveNext()\n--- End of stack trace from previous location ---\n at RestSharp.RestResponse.FromHttpResponse(HttpResponseMessage httpResponse, RestRequest request, Encoding encoding, CookieCollection cookieCollection, CalculateResponseStatus calculateResponseStatus, CancellationToken cancellationToken)\n at RestSharp.RestClient.ExecuteAsync(RestRequest request, CancellationToken cancellationToken)\n at SMSApi.Api.ProxyHTTP.ExecuteAsync(String uri, NameValueCollection data, Dictionary2 files, RequestMethod method) in $$$sourcepath$$$\smsapi\ProxyHTTP.cs:line 97","RemoteStackTraceString":null,"RemoteStackIndex":0,"ExceptionMethod":null,"HResult":-2146232798,"Source":"System.Private.CoreLib","WatsonBuckets":null,"ObjectName":""},"HelpLink":null,"Source":"CommunicationService","HResult":-2146233088,"StackTrace":" at SMSApi.Api.ProxyHTTP.ExecuteAsync(String uri, NameValueCollection data, Dictionary2 files, RequestMethod method) in $$$sourcepath$$$\\smsapi\\ProxyHTTP.cs:line 101\n at SMSApi.Api.Action.Base1.ExecuteAsync() in $$$sourcepath$$$\smsapi\Api\Action\Base.cs:line 28\n

@jakublabno
Copy link
Collaborator

jakublabno commented May 16, 2023

Hello, please check new version which uses newer RestSharp (109.0.1) library, as per my tests, everything works well - https://www.nuget.org/packages/SMSAPI.pl/2.2.0

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

3 participants