Bug 38005 - Building solution a second time will show 0 warnings even if there are actually warnings.
Summary: Building solution a second time will show 0 warnings even if there are actual...
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General ()
Version: Trunk
Hardware: PC Mac OS
: --- normal
Target Milestone: master
Assignee: Bugzilla
Depends on:
Reported: 2016-01-25 18:46 UTC by Kyle White
Modified: 2016-01-26 16:14 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Kyle White 2016-01-25 18:46:43 UTC
If your project has warnings, and you build it twice, XS will display 0 warnings. 

Steps to reproduce:
1) Write some code that will produce a warning, for example declare a variable and don't use it
2) Build the solution the first time (or rebuild) 
3) XS shows your the warning in status bar and Errors pad
4) Build again

There should still be a warning for the never used variable.

XS says there are no warnings

Comment 1 Matt Ward 2016-01-26 09:05:43 UTC
I believe this has always been how xbuild or MSBuild has worked. The warning will be displayed again the second time you build if you do a Rebuild or if you make another change in the file and select Build. If you just do a Build then Xamarin Studio is not doing a full build so the warning does not appear since most likely Xamarin Studio is not recompiling the existing assemblies, since nothing has changed, so no warnings are found.

Xamarin Studio has the same behaviour as Visual Studio here. If you build the project again in Visual Studio, with no changes to the file, then the warning is not displayed. If you Rebuild or edit the file then the warning is displayed again. Errors are always displayed.
Comment 2 Kyle White 2016-01-26 13:50:01 UTC
If you look at 0:23 in the screencast, which is after the second build. The text editor (Roslyn?) still knows of the warning. Can we not use this information to show warnings?
Comment 3 Matt Ward 2016-01-26 14:08:11 UTC
Possibly. Currently on warnings from the build are shown in the Errors window. Although I suspect only open files would have any warnings found.
Comment 4 Kyle White 2016-01-26 16:14:29 UTC
I suspect you're right. Okay, I guess we live with this one.