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.
There never was a AddMinutes method on NSDate, even in classic. However there's one on .NET DateTime .
What happens is that we replaced the implicit cast with an explicit cast (because it's not always a lossless conversion).
That means you cannot do:
NSDateTime dt = NSDateTime.Now.AddMinutes (x);
anymore. You need to do:
NSDateTime dt = (NSDateTime) ((DateTime) NSDateTime.Now).AddMinutes (x);
or something cuter to avoid extra, not really required, conversions.
NSDateTime dt = (NSDateTime) DateTime.Now.AddMinutes (x);
That's better since (even implicit) cast means extra code (and cost) to convert between the two types.
In any case that's a sample, not a class library, issue.
Thanks Sebastien for describing the cause in detail. As per comment2 , I am closing this issue.
Not sure you should be closing it. Comment #2 is just a description / clarification of the issue, not that there's no issues. IOW It's still a bug in the sample that needs to be fixed.
> IOW It's still a bug in the sample that needs to be fixed.
Normally this would be true, and I appreciate you double-checking!
The sample in question has been updated on the branch intended for stable publishing to use the explicit cast, see https://github.com/xamarin/monotouch-samples/blob/monotouch-8.6-unified-api/Calendars/Calendars/Screens/Home/HomeController.cs#L138.
In this particular case Shruti is verifying the behavior of the API while testing the migration tool, so I think we can leave it VERIFIED. If the migration tool should be able to handle this scenario, we can REOPEN the bug (and move it to XS->iOS Add-in), but it's not currently part of the expected behavior.
Thanks Shruti and Sebastien!