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
MSBuild Task doesn't fail the build on build failure in Hosted VS2019 #11958
Comments
@wireznak could you please help out here? Thanks! |
There are two things I'd like to look into from your end, @blueelvis .
|
@wireznak I'm trying an experiment with our build pipelines. During development, code analysis and stylecop warnings may occur but we don't want them when our checks run on a pull request that is to be merged into the master branch. I'm also using the MSBuild task 1.*. I tried to send /WarnAsError as the MSBuild arguments and while it fails on my dev machine, it succeeds on the hosted build agent. I have verified and "Continue on error" is not checked. I have also enabled diagnostics when running the pipeline and here's part of the log:
Then, a build error occurs which would normally be a warning:
Then the build should fail because 8 warnings were converted to 8 errors:
But the MSBuild task succeeds:
Do you need more information? |
@maboivin This appears to be a known issue with the msbuild tool itself in which it does not issue the correct return code when the only errors are warnings that were promoted through the /WarnAsErrors switch: dotnet/msbuild#9825 Based on the debug log you provided, it appears that the MSBuild Task is correctly interpreting the return code it's been given-- the problem is that msbuild.exe is returning the wrong return code. Please report this to the DotNet team. |
Just a question for you then. On my dev machine, when I run:
And then echo %errorlevel%, it returns 1:
Should I get 0 as well? |
As I understand it, the issue appears sporadically, and may be exacerbated by the specific conditions on the build agent (meaning, our debug logging and other activities may be changing when and how much disk and processor is available to msbuild in a way that msbuild running uncontested on your machine isn't). |
This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days |
Note
Issues in this repo are for tracking bugs, feature requests and questions for the tasks in this repo
For a list:
https://github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks
If you have an issue or request for the Azure Pipelines service, use developer community instead:
https://developercommunity.visualstudio.com/spaces/21/index.html )
Required Information
Entering this information will route you directly to the right team and expedite traction.
Question, Bug, or Feature?
Type: Bug
Enter Task Name:
MSBUILD V1
Environment
Server - Azure Pipelines
Agent - Hosted (Windows 2019 with VS 2019)
Issue Description
We have a SQL Server project to build. I have set an additional argument in the MSbuild task -
/WarnasError
. Now, this works properly and fails the entire build when using the task with Windows 2016 VS 2017 Hosted agent but this doesn't fail the build when the Hosted agent is set to `Windows 2019 VS 2019) while still using the exact same task definition. -Task logs
Please let me know if there is a way to send the logs privately.
Troubleshooting
Checkout how to troubleshoot failures and collect debug logs: https://docs.microsoft.com/en-us/vsts/build-release/actions/troubleshooting
Error logs
[Insert error from the logs here for a quick overview]
The text was updated successfully, but these errors were encountered: