aspnet / AspNetWebStack

ASP.NET MVC 5.x, Web API 2.x, and Web Pages 3.x (not ASP.NET Core)
Other
858 stars 354 forks source link

Not Compatible with Sync HttpClient Send #363

Closed microalps closed 1 year ago

microalps commented 2 years ago

Functional impact

Unable to utilize new Send method implemented in NET5 - https://github.com/dotnet/runtime/pull/34948

Expected result

Return a response, same as awaiting the async version. ObjectContent does not implement SerializeToStream (even though the formatters seem to).

Actual result

NotSupportedException: The synchronous method is not supported by 'System.Net.Http.ObjectContent`1[T]'. If you're using a custom 'HttpContent' and wish to use synchronous HTTP methods, you must override its 'SerializeToStream' virtual method.

mkArtakMSFT commented 1 year ago

Thanks for contacting us. The changes in .NET (Core) are not applicable to AspNetWebStack, as it's not a .NET Core technology. AspNetWebStack runs on .NET Framework. It's not currently in active development and only critical bugs or security issues are being addressed.