Open
Description
the first 2 Create(..) signatures have examples with the first reminding users of potential concurrent activity (okay) whilst second is terser (the #3 #4 signatures contribute no enhanced example). Given that the Create method "Creates or overwrites a file in the specified path" the only reason for doing an explicit delete is if a file exists with the R/O attribute set [unlikely and would probably justify a confirmation dialog pop-up if was encountered).
So my suggestion is to remove the delete logic and comments in those 2 examples.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 29d94a8d-341c-5f29-7640-704144f60b69
- Version Independent ID: bb63691f-ecc3-0e26-3297-32b6e329d06a
- Content: File.Create Method (System.IO)
- Content Source: xml/System.IO/File.xml
- Product: dotnet-api
- GitHub Login: @dotnet-bot
- Microsoft Alias: dotnetcontent