Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
When an application is built in the IDE or with xbuild in shell, a list of warnings typically appears in the Errors dialogue or at the end of standard output. However, if the build target is called again without cleaning the solution, those messages no longer appear. Cleaning and building, or just rebuilding, causes them to be output again.
Steps to reproduce:
xbuild /t:Build ~/Downloads/WarningsTest/WarningsTest.sln
Confirm that the warning appears at the end of output.
Repeat the above command. Confirm that no warnings appear.
The compiler warnings should appear again in subsequent builds without cleaning the solution.
Version 5.3 (build 440)
Installation UUID: 47444c7f-ce4e-4ab9-a7c0-0e3b40968ddf
Mono 3.8.0 ((no/45d0ba1)
GTK+ 2.24.23 (Raleigh theme)
Package version: 308000009
Version: 4.16.0 (Business Edition)
Android SDK: /Library/Developer/adt-bundle-mac-x86_64-20140624/sdk
Supported Android versions:
2.1 (API level 7)
2.2 (API level 8)
2.3 (API level 10)
3.0 (API level 11)
3.1 (API level 12)
3.2 (API level 13)
4.0 (API level 14)
4.0.3 (API level 15)
4.1 (API level 16)
4.2 (API level 17)
4.3 (API level 18)
4.4 (API level 19)
4.4.87 (API level 20)
4.5 (API level 21)
Java SDK: /usr
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
I initially thought I wasn't seeing this with iOS apps, but they're definitely affected as well, along with just about any project type I try the above on.
This isn't a Xamarin.Android bug/IDE; this is a Visual Studio feature.
Within Visual Studio:
1. Create a new Solution: File > New > Project... > Console Application > ...
2. Within the Solution panel, right-click the Solution name > Add > New Project... > Class Library > ...
3. Edit Class1.cs within the the project from (2), and add:
#warning This is a warning.
4. Edit the Console Application project's References (from (1)), and add the project from (2).
5. Build the solution. One warning is produced, the one from (3).
6. Build the solution. The warning remains.
This appears to corroborate the behavior you want.
7. Build the solution via MSBuild in CMD.EXE.
Result: no warnings:
The problem is that when a project's outputs are Up To Date, the project is not rebuilt, and since it's the act of building the project which generates the warnings, those warnings are "lost" unless preserved "elsewhere" (what Visual Studio appears to do) OR the project is rebuilt (the "clean and rebuild" case).
Rephrased into CMD.EXE terms, after creating the solution (steps 1-4):
# generates 1 warning
# generates 0 warnings
Xamarin Studio could plausibly cache generated warnings and re-display them on Build when the project is skipped, which is what Visual Studio appears to do, but this is outside the bounds/scope of Xamarin.Android's build system.