Skip to content

iOS Build Succeeds but NewBindingMaciOS Namespace Not Found in MainPage.xaml.cs #98

@Sgudipu

Description

@Sgudipu

Description

When building the project, the build succeeds and the framework is generated. However, when trying to use the iOS binding in [MainPage.xaml.cs] I get the following error is The type or namespace name 'NewBindingMaciOS' could not be found (are you missing a using directive or an assembly reference?)

Steps to Reproduce

  1. Build the solution, including the NewBinding.MaciOS.Binding project.
  2. Build the Maui project.
    2.In the Maui project (e.g., MainPage.xaml.cs), add the following code:
#if IOS || MACCATALYST
using NewBinding = NewBindingMaciOS.DotnetNewBinding;
#endif
<!-- Reference to MaciOS Binding project -->
	<ItemGroup Condition="$(TargetFramework.Contains('ios')) Or $(TargetFramework.Contains('maccatalyst'))">
        <ProjectReference Include="..\macios\NewBinding.MaciOS.Binding\NewBinding.MaciOS.Binding.csproj" />
    </ItemGroup>

Please advise how to ensure the iOS binding is correctly referenced and available in the Maui project.

Link to public reproduction project repository

No response

Environment

  • OS: Mac 15
  • .NET MAUI: 9.0
  • Target platforms: IOS, Mac catalyst.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions