dotnet/msbuild

Warn about WriteLinesToFile default behavior which is Append

开放

#11,927 创建于 2025年5月29日

 (7 条评论) (0 个反应) (1 位负责人)C# (1,364 个派生)batch import
help wantedtriaged

仓库指标

星标
 (5,062 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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?

贡献者指南