-
Notifications
You must be signed in to change notification settings - Fork 6k
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
/Client/ApiClient.cs(137,51,137,69): error CS1503: Argument 2: cannot convert from 'System.Action<System.IO.Stream>' to 'byte[]' #8620
Comments
I'm hitting this because I'm building with dotnet core 2.1 and not the .Net Framework. Compiles but didn't test yet:
|
Similarly, this compiles for me on .NET framework 4.6:
I'm wondering whether this is caused by a change in RestSharp or a bug in the moustache file. |
Same here, and compiled OK on .NET Framework 4.7.2 |
I'm getting this error too, regardless of the .net framework. If I add param.Value.ContentLength to: request.AddFile(param.Value.Name, param.Value.Writer, param.Value.FileName, param.Value.ContentType); Resulting in : It solves the problem. |
Unfortunately I have this exact same issue with |
I am also getting the exact issues as @andrewfinnell . |
Having to fix the generated client after every regeneration is a huge pain in the rear. On a .NET Core 2.2 project we have to change this:
to this:
after every regeneration. The same thing is reproducible when the project is targeting .NET 4.7.2 |
I have that error too on .NET 4.7.2 |
1 similar comment
I have that error too on .NET 4.7.2 |
I have the same error too on .NET 4.6.2 Did anyone found out what the problem is? |
In my case I solve the problem just adding 'ContentLength' parameter in the method that others users said. The problem for me is that I update the version of RestAPI 105.1.0 to the lasted 106.11.7 (20/12/2020) and the lasted don't have the method olded. Function only in old version RestAPI 105.1.0. Function changed one parameter added in version RestAPI 106.11.7 So, method old is obsoleted, update to new method and it's be work like a charm. |
What would it take to get this fix into an official release? Having to manually modify these files complicates our CI/CD pipelines. |
I'm still running into this issue on .Net 4.8 (which I'm not sure if matters at all) with RestSharp 106.15.0. Would appreciate a fix for it since the manual edit does add efforts to maintain. |
Description
There is an error when I build it in Visual Studio .
Error : Client/ApiClient.cs(137,51,137,69): error CS1503: Argument 2: cannot convert from 'System.Action<System.IO.Stream>' to 'byte[]'
Swagger-codegen version
2.3.1
Swagger declaration file content or url
swagger.txt
Command line used for generation
java -jar ./swagger-codegen-cli-2.3.1.jar generate -i ./swagger.json -l csharp -o ./csharp
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement
The text was updated successfully, but these errors were encountered: