Skip to content

Conversation

filzrev
Copy link
Contributor

@filzrev filzrev commented Aug 19, 2025

This PR intended to fix #8654. (Related PR #10637 #10785)

What's changed in this PR

  1. Replace File.Create to new FileStream with FileShare.ReadWrite
  2. Cleanup _noRandomFile code.

Background
There is a comment that IOException issue is occurred when build docs with docfx serve.

It is possible for an IOException to be thrown when when the docfx build and docfx serve commands are executed in parallel.
Because File.Create open file with FileShare.None

So it need to modify code to use FileShare.ReadWrite.

If reported issue is not resolved by this changes.
It need to use retry logics that are proposed on other PRs

@yufeih yufeih merged commit 1c9f75c into dotnet:main Sep 2, 2025
9 checks passed
@MartyIX
Copy link

MartyIX commented Sep 11, 2025

Do you plan to make a new release please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] System.IO.IOException: The process cannot access the file
3 participants