Binding: What determines Libraries.g.cs?

LarryOBrienLarryOBrien USXamarin Team Xamurai
edited August 2013 in Xamarin.iOS

I am trying to bind the ChromeCast libraries and the first steps have gone pretty easily: Objective Sharpie, some amount of cleanup, etc.

But just when I thought I was about to get a clean compile, I get:

 Error CS0117: `MonoTouch.Constants' does not contain a definition for `ChromeCastLibrary' (CS0117) (ChromeCastBinding)

When I look at the code in Libraries.g.cs, I see:

namespace MonoTouch {
static class Libraries {
    static public class ChromeCast {
        static public readonly IntPtr Handle = Dlfcn.dlopen (Constants.ChromeCastLibrary, 0);

Which makes me scratch my head. I don't even have the string or symbol "ChromeCastLibrary" in my project, as far as I know!

What should I do to get rid of this message?


  • MigueldeIcazaMigueldeIcaza USXamarin Team Xamurai
    edited August 2013

    Make sure that you specify the Library where it comes from on the [Field] and set that to "__Internal", this should work:

    [Field ("FooBar", "__Internal")]
    NSString FooBar { get; }

  • LarryOBrienLarryOBrien USXamarin Team Xamurai

    That worked perfectly, thanks!

Sign In or Register to comment.