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

Moving Photino.Blazor to Hosting #122

Open
wants to merge 43 commits into
base: debug
Choose a base branch
from

Conversation

Denny09310
Copy link
Contributor

I managed to implement the IHostBuilder and IHostApplicationBuilder interfaces into the PhotinoBlazorAppBuilder. It's a bit of a hack job for now, though, mostly copy/pasting with a sprinkle of tweaks from the .NET source, just to get something going.

This can be useful for all the Hosting extensions and/or internal services that Microsoft.Extensions.Hosting offers and a way to register them gracefully inside the photino builder

@kimdiego2098
Copy link

is this work feasible?

@Denny09310
Copy link
Contributor Author

Denny09310 commented Aug 25, 2024

is this work feasible?

Yes. I've used it successfully in one of my projects without encountering errors (for now 😁)

@MikeYeager
Copy link
Collaborator

@Denny09310 We see what you're doing here and it looks like a nice addition. We're curious why you copied .NET source code into here instead of referencing the .NET code? "I managed to implement the IHostBuilder and IHostApplicationBuilder interfaces into the PhotinoBlazorAppBuilder"

@Denny09310
Copy link
Contributor Author

Denny09310 commented Feb 6, 2025

Unfortunately, most of the functionality is internal to Microsoft.Extensions.Hosting. I may have overlooked something, but so far, I haven’t found a way to integrate those internal classes into the Photino.Blazor project while maintaining full access to their features. The main drawback of copying these files is the need to keep them in sync with the originals. Ideally, it would be better to find a way to access those classes without duplicating them.

@Denny09310
Copy link
Contributor Author

Denny09310 commented Feb 18, 2025

@MikeYeager, after a thorough investigation, I've discovered that the solution was simpler than expected. I removed all the .NET source code files and implemented both the IHostApplicationBuilder and IHost within the Photino* classes. I ran all the sample applications, and everything appears to be working, though it likely requires more testing—especially concerning the IFileProvider request noted in previous issues. Currently, it uses the classic Blazor strategy (searching for the wwwroot), but I'm not sure if that behavior can be overridden.

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

Successfully merging this pull request may close these issues.

3 participants