Mac Catalyst Binding Library not callable
See original GitHub issueDescription
It appears anything in the ApiDefinition.cs and StructsAndEnums.cs of a Mac Catalyst Binding Library is not callable from MAUI (or other) code.
With a barebones Mac Catalyst Binding Library containing only the following interface declaration:
[BaseType(typeof(NSObject))]
interface Widget
{
}
Strangely, in Visual Studio for Mac 2022 Preview 17.5 there is no syntax highlighting for BaseType and NSObject:

I cannot reference this class or any other code defined in these files from either a MAUI app or any other class library: It cannot resolve the references. (“the type or namespace could not be found”)
If I create a separate class file within the Mac Catalyst Binding Library, then I am able to reference that class from MAUI with no issues. However, even within this separate class file I cannot reference code from the ApiDefinition.cs or StructsAndEnums (see file EmptyClass.cs in reproduction project repo)
In Xamarin.Mac it was possible to reference a Bindings Library in the way it currently fails for MAUI.
Note: In this example I am not actually adding a Native Framework to the Bindings Library, but I can confirm that in the ‘real’ project where I encountered this issue that I have the exact same issue when there is a proper Native Framework reference in the Bindings Library.
Steps to Reproduce
- Create new MAUI project
- Disabling all-but Mac Catalyst functionality
- Create new Mac Catalyst Binding Library
- Adding small interface definition to
ApiDefinition.csto test if it can be referenced
- Adding small interface definition to
- Add reference to Mac Catalyst Binding Library from MAUI project
- Try to reference code from
ApiDefinition.csin the MAUI project, it will not resolve and the build will fail.
Link to public reproduction project repository
https://github.com/4or5trees/maui-macos-binding-problem
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
macOS
Affected platform versions
macOs 12.6, VS for Mac 2022 Preview 17.5
Did you find any workaround?
No response
Relevant log output
No response
Issue Analytics
- State:
- Created 9 months ago
- Comments:5 (3 by maintainers)

Top Related StackOverflow Question
@drasticactions it’s a known issue that syntax highlighting doesn’t work properly when using binding projects as project references (https://github.com/xamarin/xamarin-macios/issues/10148). However, the solution should build just fine (although I also believe there are some issues with binding projects not quite working correctly on Windows, but that doesn’t seem to be the scenario here).
@drasticactions Thank you very much! Referencing the built DLL of my bindings project fixes my issue.