Closed KirillOsenkov closed 1 year ago
This is where we currently log MSB3021 instead of MSB3026: https://github.com/microsoft/MSBuildSdks/blob/c80b0340f4748fb667a48ff4d4f3e61a133dff46/src/CopyOnWrite/Copy.cs#L761
See also #493
The noted MSB3021 code above is consistent with the same code path in MSBuild, which emits Copy.Error resource with this string value. Not updating.
<value>MSB3021: Unable to copy file "{0}" to "{1}". {2}</value>
CopyOnWrite needs to preserve the exact warnings the classical Copy task emits. For instance, classical Copy emits MSB3026 when the file is locked, in these two places:
https://github.com/dotnet/msbuild/blob/c36a54ed3308d1516ffe1a86b9086c42e4ca996f/src/Tasks/Copy.cs#L872-L874
https://github.com/dotnet/msbuild/blob/c36a54ed3308d1516ffe1a86b9086c42e4ca996f/src/Tasks/Copy.cs#L898-L900
If we don't replicate this, builds will fail when converted to CopyOnWrite.
For example we have
<MSBuildWarningsAsMessages>MSB3026</MSBuildWarningsAsMessages>
that is suppressed just fine normally, but stopped working after we started using CopyOnWrite.@inthemedium @erikmav