Bug 34781 - [Feature Request] Add an option to make "Warning: Mono TODO" warnings force a build error.
Summary: [Feature Request] Add an option to make "Warning: Mono TODO" warnings force a...
Status: CONFIRMED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: MSBuild ()
Version: 2.0.2
Hardware: Macintosh Mac OS
: Lowest enhancement
Target Milestone: master
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-10-12 16:28 UTC by Jon Goldberger [MSFT]
Modified: 2016-09-26 21:59 UTC (History)
2 users (show)

Tags:
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 for Bug 34781 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Jon Goldberger [MSFT] 2015-10-12 16:28:47 UTC
## Description

When calling a method/property that displays a yellow underline in source code with the message "Warning: Mono TODO", customer asks fi there is a way to force a build error when using this code. An example is the static "HttpWebRequest.DefaultMaximumErrorResponseLength" property. This does show the warning in the source code, but the build succeeds and instead, understandably, throws a NotImplemented exception at run time. 

## Steps to reproduce.

1. Open Xamarin studio and create a new Xamarin.Mac project. 

2. Add the following line of code in the ViewController's ViewDidLoad override:
var errorlength = HttpWebRequest.DefaultMaximumErrorResponseLength;

The expected result is as actual, but the question is whether the above can cause a build error rather than only a source code warning and a run time exception.
Comment 1 Chris Hamons 2015-10-13 09:20:08 UTC
This was be a non-trivial amount of work. We could have our linker scan their entire program, come up with a list of all BCL methods called, and then reflect for the TODO attribute.

http://www.mono-project.com/docs/tools+libraries/tools/moma/command-line-moma/

is a tool we already have that does this. 

I'm going to keep this around in case other
Comment 2 Chris Hamons 2015-10-13 09:20:55 UTC
^ thanks bugzilla.

in case other people request this feature, but right now it is a low priority, since we already have a released tool you can integrate into your build process if you desire.