How to release a file written with JsonSerializer.Serialize(Utf8JsonWriter)?
Summary The Utf8JsonWriter you create with new(File.Create(…)) owns the underlying `FileStream, and disposing the writer does not close that stream. The file remains locked, so the subsequent File.OpenRead fails with “the process cannot access the file … because it is being used by another process.” The fix is to also dispose the FileStream (or use … Read more