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

Handler with API cannot be referenced by MAUI project. #147

Open
QadiymStewart opened this issue Jan 10, 2025 · 1 comment
Open

Handler with API cannot be referenced by MAUI project. #147

QadiymStewart opened this issue Jan 10, 2025 · 1 comment

Comments

@QadiymStewart
Copy link

Great libary, running into an issue. I have a project containing A MAUI project, a Blazor Web Project and an RCL for shared components.
All my handlers are in the RCL project under feature folders.

By adding [MapGet("/api/orders")] to my handler and app.MapProjectEndpoints();
The build fails.

I have to add to the RCL project causing the MAUI app not to build.

There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'iossimulator-x64'.
There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'maccatalyst-x64'.

Can you provide some guidance? My end goal is for the web and maui app to share the handlers and get the benefits of the generated api endpoints also.

@viceroypenguin
Copy link
Member

I'm not sure that this scenario is possible, since the MAUI project can't contain reference to aspnetcore at all.

I think the larger solution would be to create a way to create IA endpoints in the blazor web project that point to the shared project handlers. However, that would be a fairly large project to add that feature into IA.

I'll leave this open for now, but I don't think I can work on it in the near future.

One alternative:

  • create your shared handlers in the RCL
  • create wrapper handlers in the web project and put the IA endpoints on the wrapper handlers

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