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.
Created attachment 10814 [details]
The ApiDefinitions file
When I try to convert my very simple test .framework I run into problems when I try to use mac
//! Project version number for Simple.
//FOUNDATION_EXPORT double SimpleVersionNumber;
//! Project version string for Simple.
//FOUNDATION_EXPORT const unsigned char SimpleVersionString;
// In this header, you should import all the public headers of your framework using statements like #import <Simple/PublicHeader.h>
@interface Simple : NSObject
- (NSString *)run;
- (NSString *)run
MacBook-Pro:Frameworks User$ mono /Users/User/Code/monomac/monomac/src/bmac.exe -o Simple2.dll --tmpdir=/tmp -baselib=/Users/User/Code/monomac/monomac/src/MonoMac.dll -r=System.Drawing ApiDefinitions.cs -v
mcs -sdk:4 -debug -unsafe -target:library ApiDefinitions.cs -nowarn:436 -out:/tmp/temp.dll -r:/Users/User/Code/monomac/monomac/src/bmac.exe -r:System.Drawing -unsafe -r:/Users/User/Code/monomac/monomac/src/MonoMac.dll
error BI0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com
System.NullReferenceException: Object reference not set to an instance of an object
at Generator.Generate (System.Type type) [0x00000] in <filename unknown>:0
at Generator.Go () [0x00000] in <filename unknown>:0
at BindingTouch.Main2 (System.String args) [0x00000] in <filename unknown>:0
at BindingTouch.Main (System.String args) [0x00000] in <filename unknown>:0
@Lucas - I took a look at your example and have a few questions/comments.
- Your binding is not in a namespace. Having all of your code in a namespace is generally a good idea.
- It appears you are using the open source MonoMac framework. Just FYI - we've made a number of improvements with binding generation / bmac in Xamarin.Mac.
- https://developer.xamarin.com/samples/mac/XMBindingExample/ uses Xamarin.Mac, but is a good example of the process start to finish.
- I believe (at least one of) the problems you are running into is due to the name of your binding file. Our binding generator uses the file name by default to generate the .NET namespace to output code to, and '-' is not a valid character.
You can sometimes dig into issues with our code generator by using --sourceonly=files.txt and opening the files listed there to see what was generated.
Let me know if that solves your issue.