Bug 25647 - [Unified API] MT2002 Failed to resolve System.DateTime Foundation.NSDate
Summary: [Unified API] MT2002 Failed to resolve System.DateTime Foundation.NSDate
Status: RESOLVED ANSWERED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 8.6.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-12-29 21:22 UTC by John Miller [MSFT]
Modified: 2014-12-31 14:35 UTC (History)
3 users (show)

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


Attachments
Test Case (11.82 KB, application/zip)
2014-12-30 13:36 UTC, John Miller [MSFT]
Details
Diagnostic Build Ouput (150.61 KB, text/plain)
2014-12-30 13:37 UTC, John Miller [MSFT]
Details


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:
Status:
RESOLVED ANSWERED

Description John Miller [MSFT] 2014-12-29 21:22:12 UTC
**Overview:**

   Build error when trying to build a Unified API iOS project for Device and linking set to Link SDK Only

**Actual Results:**

   MTOUCHTASK: error MT2002: Failed to resolve "System.DateTime Foundation.NSDate::op_Implicit(Foundation.NSDate)" reference from "Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065"

**Expected Results:**

   No issues.

**Build Date & Platform:**

   === Xamarin Studio ===

Version 5.7 (build 660)
Installation UUID: e01c3049-a2d2-4e0a-aad8-afe6fb627c4d
Runtime:
	Mono 3.12.0 ((detached/1538a59)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000072

=== Apple Developer Tools ===

Xcode 6.1.1 (6611)
Build 6A2008a

=== Xamarin.iOS ===

Version: 8.6.0.44 (Business Edition)
Hash: 1dcff0f
Branch: 
Build date: 2014-12-22 17:34:59-0500

=== Build Information ===

Release ID: 507000660
Git revision: 6a74f9bdb90d9415b597064d815c9be38b401fee
Build date: 2014-12-18 00:38:00-05
Xamarin addins: 57be0f5e1433cb58b70ea9b52e9dc77ad791be40

=== Operating System ===

Mac OS X 10.10.0
Darwin Johns-MacBook-Pro-2.local 14.0.0 Darwin Kernel Version 14.0.0
    Fri Sep 19 00:26:44 PDT 2014
    root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64


**Additional Information:**

   Worked around this by setting linking to All Assemblies.
Comment 1 Abhishek 2014-12-30 06:58:42 UTC
I have tried to reproduce this issue but unable to reproduce this issue.

Steps I had followed:
1. Created an Unified API iOS project.
2. Changes the linker options as Link SDK only.

On running Application I am not getting any error or exception and Application deploys successfully on the device(iPhone 5c).

Could you please let me know if i have missed any steps?

If you are getting this issue with any specific application then please add Test sample with the bug if possible. Also please add diagnostic build output and IDE log.

Build Info:

=== Xamarin Studio ===

Version 5.7 (build 660)
Installation UUID: 93e693b0-b53d-40f4-b29c-b61ff5cbe892
Runtime:
	Mono 3.12.0 ((detached/a813491)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000068

=== Apple Developer Tools ===

Xcode 6.1 (6604)
Build 6A1052d

=== Xamarin.iOS ===

Version: 8.6.0.44 (Business Edition)
Hash: 1dcff0f
Branch: 
Build date: 2014-12-22 17:34:59-0500

=== Xamarin.Android ===

Version: 4.20.0.28 (Business Edition)
Android SDK: /Users/xamarin23/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		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)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin.Mac ===

Version: 1.10.0.18 (Business Edition)

=== Build Information ===

Release ID: 507000660
Git revision: 6a74f9bdb90d9415b597064d815c9be38b401fee
Build date: 2014-12-18 00:38:00-05
Xamarin addins: 57be0f5e1433cb58b70ea9b52e9dc77ad791be40

=== Operating System ===

Mac OS X 10.10.0
Darwin xamarin23s-Mac-mini.local 14.0.0 Darwin Kernel Version 14.0.0
    Fri Sep 19 00:26:44 PDT 2014
    root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
Comment 2 John Miller [MSFT] 2014-12-30 13:36:08 UTC
Created attachment 9210 [details]
Test Case

Attached is a project with the minimum I needed to reproduce this. 

I noticed this issue when using the reactiveui package.
Comment 3 John Miller [MSFT] 2014-12-30 13:37:21 UTC
Created attachment 9211 [details]
Diagnostic Build Ouput

Attached diagnostic build output from the Test Case project.
Comment 5 Sebastien Pouliot 2014-12-30 21:46:52 UTC
There's no implicit conversion between DateTime and NSDate in the unified API (because it's not a lossless operation).

If you get this error it means you're using a binary component that was not rebuilt with the final/stable (8.6) API.

> I noticed this issue when using the reactiveui package.

That's likely the component that needs to be rebuilt.