CommunityToolkit / CommunityToolkit/Maui.NativeLibraryInterop

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

Open
#98 5 comments 1 reaction 0 assignees View on GitHub
Dominant language
C#
Stars
249
Forks
48
PR merge metrics
No merged PRs in 30d

Description

### 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
```
```




```
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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with MainPage.xaml.cs and the conditional ProjectReference shown in the issue, then compare the NewBinding.MaciOS.Binding project output with the MAUI target frameworks. Done means the NewBindingMaciOS.DotnetNewBinding namespace resolves in the iOS and Mac Catalyst builds and the MAUI project builds successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, ios
Domain
build-system, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.