-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
The PipeWriter 'ResponseBodyPipeWriter' does not implement PipeWriter.UnflushedBytes #108075
Comments
@BrennanConroy FYI |
Update your Microsoft.AspNetCore.Mvc.Testing reference. |
Hi @BrennanConroy . Now it works! with Microsoft.AspNetCore.Mvc.Testing 9.0.0-rc.1.24452.1 Thank you so much |
same situation here: got the exception => update to 9.0.0-rc.1.24452.1 => solved! |
Unfortunately this didn't help me. I have a .NET 8 API project I wanted to convert to 9 and I get this error in my tests. I have tried the specific version and the release version of 9.0.0 and I still get the error. I have verified there aren't any nuget updates for this release or preview. I did notice that I had to manually add I guess for now I will stick with .NET 8. This is what my CSPROJ looks like. <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<None Remove="appsettings.json" />
</ItemGroup>
<ItemGroup>
<Content Include="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.3" />
<PackageReference Include="NSubstitute" Version="5.3.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.SqlClient" Version="1.9.0-beta.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\MY.API\MY.API.csproj" />
</ItemGroup>
<ItemGroup>
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
</ItemGroup>
<ItemGroup>
<Folder Include="OpenTelemetry\" />
</ItemGroup>
</Project> |
This seems to be a breaking change when running net6 and net8 test code against the net9 runtime. Is that expected? I didn't see it called out in the NET9 release notes. I put a repro up at https://github.com/craigb/pipewriter-repro -- when you set RollForward to LatestMajor, it will use the net9 runtime and the code will break. |
That makes sense. .NET 9's JSON implementation relies on |
This issue has been moved from a ticket on Developer Community.
Microsoft Visual Studio Enterprise 2022 (64-bit) - Preview
Version 17.12.0 Preview 2.0
Solution: Minimal Web Api and Xunit (.NET 9.0.0-rc.1.24431.7)
WebApiXunit3.zip
The error:
The PipeWriter ‘ResponseBodyPipeWriter’ does not implement PipeWriter.UnflushedBytes
The same code works fine in .NET 8
Original Comments
Feedback Bot on 9/18/2024, 00:30 AM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
Feedback Bot on 9/19/2024, 02:55 AM:
Thank you for sharing your feedback! Our teams prioritize action on product issues with broad customer impact. See details at: https://docs.microsoft.com/en-us/visualstudio/ide/report-a-problem#faq. In case you need answers to common questions or need assisted support, be sure to use https://visualstudio.microsoft.com/vs/support/. We’ll keep you posted on any updates to this feedback.
The text was updated successfully, but these errors were encountered: