dotnet/msbuild

Warn about WriteLinesToFile default behavior which is Append

Open

#11.927 aberto em 29 de mai. de 2025

Ver no GitHub
 (6 comments) (0 reactions) (0 assignees)C# (1.364 forks)batch import
help wantedtriaged

Métricas do repositório

Stars
 (5.062 stars)
Métricas de merge de PR
 (Mesclagem média 11d 7h) (125 fundiu PRs em 30d)

Description

WriteLinesToFile appends by default unless you specify Overwrite. This is highly non-intuitive and probably almost never what the user intends.

Since we can't change the behavior, I propose to introduce a new optional parameter Append, that defaults to false, and if it's not specified and Overwrite is not specified, warn about it (that you should specify one or the other).

Not sure if a warning or a message, perhaps build check?

Guia do colaborador