Bug 12535 - Using Sparkle bindings
Summary: Using Sparkle bindings
Status: RESOLVED FIXED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Other ()
Version: 1.4.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Aaron Bockover [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2013-06-04 09:06 UTC by David Lambert
Modified: 2013-06-06 04:39 UTC (History)
3 users (show)

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


Attachments
Test projects (7.77 MB, application/zip)
2013-06-04 09:06 UTC, David Lambert
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 FIXED

Description David Lambert 2013-06-04 09:06:08 UTC
Created attachment 4061 [details]
Test projects

I can't make my Sparkle bindings work with Xamarin.Mac. Here is what I do:

Build MonoMac from source with the bindings (sparkle.cs) found in the folder "xammac sparkle bindings". The attached project "SparkleTest MonoMac" uses it and it works.

Build Xamarin.Mac compatible dll using the makefile found in the folder "xammac sparkle bindings". The attached project "SparkleTest XamMac" uses it with the XamMac.dll from the makefile and it doesn't work.

The library spawns fine but here is what I get on the SharedUpdater getter:

System.InvalidCastException: Cannot cast from source type to destination type. at at MonoMac.Sparkle.SUUpdater.get_SharedUpdater ()

What am I doing wrong? Is there a bug?
Comment 1 Sebastien Pouliot 2013-06-05 22:36:49 UTC
Sorry it took some time. The attached samples did not work (they were renamed and the script to copy the framework did not work anymore, giving null values for both).

Anyway the issue is that it's missing a call to register the assembly. Add this line to your AppDelegate before it calls anything from your sparkle assembly.

	Runtime.RegisterAssembly (typeof (SUUpdater).Assembly);

I'll need to check on the Growl project - I might have forgotten to commit this (or something else changed wrt registration since then).

Note: this works for iOS since we know, at build time, every assembly being used - so it's easy to register all of them (at app startup). That's not the case when JITing, emitting new code or downloading new code.
Comment 2 David Lambert 2013-06-06 04:39:38 UTC
No problem. Sorry for renaming the project I didn't think about that!

Thanks a lot it now works.