Bug 8339 - Disable Compiler Warnings
Summary: Disable Compiler Warnings
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 4.2.x
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: dean.ellis
Depends on:
Reported: 2012-11-12 10:07 UTC by Allie Miller
Modified: 2012-11-13 09:47 UTC (History)
3 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 Allie Miller 2012-11-12 10:07:51 UTC
Currently, there is no way to disable compiler warnings for all the public properties. They do not have documentation added to them. 

When the "Xml documentation file" property is enabled (Build tab of Project properties), a XML file will be generated along with the build output. This XML file contains all XML-comments found in code.

When the property is enabled, the compiler generates warnings for all public code that doesn't contain XML-comments in code.

It would be good if the Resources.Designer.cs would either include XML-comments or be made internal (as it wouldn't be referenced from outside the assembly anyways)

Currently, when the compiler warnings show, there is no problem building/deploying the app. But it is still necessary to minimize the number of compiler warnings while still generating XML documentation.

Creating a partial Resource class has not helped. 

The only option is changing the way the Resource.Designer.cs is generated by either:

a. Placing XML comments on each and every class, property in the file

b. Generating an internal class instead of public

c. Placing a #pragma ignore at the top of the file to ignore all warnings of a specific kind

A good alternative would be to add the GeneratedCode attribute. Or to to wrap the file contents in "#pragma warning disable ..."
Comment 1 dean.ellis 2012-11-12 16:16:48 UTC
Fixed in master/0f811a215f

The fix adds the GeneratedCode attribute to the generated Resources
class so that it is clear this is a generated class. 

It also adds two #pragma calls at the beginning and end of the
file. One to ensure that warnings about no xml comments are ignored and the other to restore the warnings for the remainder of the build process.