OpenAI-API-dotnet icon indicating copy to clipboard operation
OpenAI-API-dotnet copied to clipboard

Downgrading to .NET Framework 4.x

Open GarryLowther opened this issue 2 years ago • 1 comments

For legacy reasons we wanted to use your project against a .Net Framework 4.x project but we cannot get it to compile. Errors with your use of the latest v8 C# foreach construct. When we use your library compiled to .NET Standard 2.0, we get the following error from .NET Framework 4.x projects: System.Net.Http.HttpRequestException: 'An error occurred while sending the request.

Any pointers would be helpful?

GarryLowther avatar Mar 10 '23 19:03 GarryLowther

If you set a breakpoint while sending the request any chance you can see what the actual HttpRequestException is? Mostly its an error code returned from the server in the 400 range or 500 range.

Target framework: .netstandard2.0 is compatible with: image

https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0

Baklap4 avatar Mar 13 '23 07:03 Baklap4