-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ToolTasks Can Log MSB4181 When Cancelled #5508
Comments
Someone else brought this up with me but I can't find it now. I agree. |
The <Project>
<Target Name="Build">
<ItemGroup>
<SourceFiles Include="Foo" />
</ItemGroup>
<Copy SourceFiles="@(SourceFiles)"
DestinationFolder="$(MSBuildBinPath)"
ContinueOnError="true"
Retries="0" />
</Target>
</Project>
When ContinueOnError is set, I wouldn't expect to get this warning as errors were technically mutated to a warning. When I saw this, a user had suppressed |
Poking at this a little bit with MSB4188 is never emitted, right? |
@danmoseley I don't repro this issue. This may have been fixed with our various taskhost HasLoggedErrors PR's. Closing this in favor of #5912 which I think is a larger issue with tooltasks. EDIT: It occurred to me the other issue is specific to LC (not necessarily cancelling), so I'll stick with this as the canonical issue that ANY tooltask that is cancelled can log this error. |
Yes that seems different. I do still see this from time to time and we keep relatively up to date with SDK builds |
Steps to reproduce
Assume there is a tool named "sleep" in the path. Build this project, then hit Ctrl-C.
Actual behavior
Expected behavior
If the task was canceled, suppress MSB4181.
MSB4181 is a grumble that the task does not follow the contract of "return false if an only if you logged an error". But in the case of cancelation, this error is useless for the user, who just hit Ctrl-C, and for the task author, who returned immediately exactly as the engine required them to. We don't want task authors to start logging bogus errors on cancelation. Just continue and fail the build with
MSB4188: Build was canceled
in the normal way.Environment data
The text was updated successfully, but these errors were encountered: