-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Incomplete file when using StreamWriter / WriteLineAsync with .NET 6 preview 3 #52811
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to this area: @carlossanlop Issue DetailsDescriptionWhen using a
You can see that the file start at the middle of line 113: Configuration
Regression?Yes, it works with .NET 5.0 Other informationIt works well with
|
Looking at the code, it seems the issue is because I'm using an encoding with a BOM. It seems runtime/src/libraries/System.Private.CoreLib/src/System/IO/StreamWriter.cs Lines 944 to 946 in 8194ffb
|
Description
When using a
StreamWriter
to write a file line by line, the beginning of the file is missing.You can see that the file start at the middle of line 113:
Configuration
Regression?
Yes, it works with .NET 5.0
Other information
It works well with
WriteLine
instead ofWriteLineAsync
.File.WriteAllLineAsync
is also ok.The text was updated successfully, but these errors were encountered: