Bug 4212 - use of included nunitlite.dll breaks custom monotouch.dialog build
Summary: use of included nunitlite.dll breaks custom monotouch.dialog build
Status: RESOLVED ANSWERED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 5.2
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-04-03 17:59 UTC by Daniel
Modified: 2015-10-28 18:55 UTC (History)
3 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 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 Daniel 2012-04-03 17:59:38 UTC
I dont understand exactly what is happening but reproduction is easy.

Checkout a copy of monotouch.dialog from github and build it.

Then include some empty test fixtures and a reference MonoTouch.NUnitLite.

Run the MT.D samples. Select the Indexed sample, and attempt to use the search feature. An exception is raised:


Message: "Source array type cannot be assigned to destination array type."
Source: "MonoTouch.Dialog-1"
Stacktrace: 
  at (wrapper stelemref) object:virt_stelemref_complex (intptr,object)
  at MonoTouch.Dialog.DialogViewController.StartSearch () [0x00048] in /Developer/MonoTouch/Source/MonoTouch.Dialog/MonoTouch.Dialog/DialogViewController.cs:190 
  at MonoTouch.Dialog.DialogViewController+SearchDelegate.OnEditingStarted (MonoTouch.UIKit.UISearchBar searchBar) [0x00007] in /Developer/MonoTouch/Source/MonoTouch.Dialog/MonoTouch.Dialog/DialogViewController.cs:265 
  at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00042] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:29 
  at Sample.Application.Main (System.String[] args) [0x00000] in /Users/dmacd/Documents/Cook/MonoTouch.Dialog/Sample/Main.cs:15 


Remove the NUnitLite refs (and the implicit MT.D-1 ref) and everything is fine. 

I just noticed this on an app I'm working on. I need both my customized MT.D build AND my unit tests, so I'm blocked on this until I understand what to do, short of ripping out and rebuilding NUnitLite to reference my own MT.D.
Comment 1 Sebastien Pouliot 2012-04-03 20:18:32 UTC
A quick guess is that MonoTouch.Dialog-1, the assembly shipping with MonoTouch, and MonoTouch.Dialog (from github) cannot co-exist (easily) together since they will both try to register (to Objective-C) the same class names.

An immediate workaround (to unblock you) is to build MonoTouch.NUnitLite from github [1], since this is open source too, against the MonoTouch.Dialog from github - and ensure you're not referencing MonoTouch.Dialog-1 (you'll need to adjust the solution, sln, from github).

[1] https://github.com/spouliot/Touch.Unit
Comment 2 Rolf Bjarne Kvinge [MSFT] 2015-10-28 18:55:08 UTC
Sebastien's diagnosis is probably correct, the open-source version of MonoTouch.Dialog will clash with the version we ship, so both can't be used at the same time.