Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project setting ImplicitUsings must be enabled #47

Open
andyzukunft opened this issue Jan 21, 2025 · 2 comments
Open

Project setting ImplicitUsings must be enabled #47

andyzukunft opened this issue Jan 21, 2025 · 2 comments

Comments

@andyzukunft
Copy link

Hey all,

I am using PageResolver v1 for a while now and want to implement PageResolver v2.5.3 using the .NET 8+ code generator feature in a new project. I discovered that <ImplicitUsings>enable</ImplicitUsings> must be set on the MAUI project in order for PageResolver v2 to work at all (at least at "default" settings).
If ImplicitUsings are not enabled the project will not build as soon as PageResolver nuget package has been added. I am using MAUI .NET 9 targetind Android and iOS. The build error reads as The type or namespace 'MauiAppBuilder' could not be found in PageResolverExtensions.

Image

I wonder if this is a limitation or a bug? It is not documented as far as I can tell.

Best regards

@matt-goldman
Copy link
Owner

Thanks for reporting this @andyzukunft. I can explicitly add that namespace import to the generated files. As a workaround in the meantime if you don't want to enable implicit usings, you could add a global using statement for Microsoft.Maui.Hosting somewhere in your project.

@andyzukunft
Copy link
Author

If it is simple to implement I would suggest to add the namespace to the code generator. As an interim solution documenting this behaviour should be fine.

I did enable implicit usings and I think I will keep it that way. It seems I was the only one not enabling it anyway ;-).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants