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

Load url after Load static HTML file doesn't work #220

Open
r-pankevicius opened this issue Oct 22, 2024 · 4 comments
Open

Load url after Load static HTML file doesn't work #220

r-pankevicius opened this issue Oct 22, 2024 · 4 comments
Labels
All OS question Further information is requested

Comments

@r-pankevicius
Copy link

OS: Win11.

I updated Photino.NET package to latest today (3.1.18) and noticed that app starts freezing in "loading page".

Our app initially (from Main, STAThread) loads loading screen from the file, then after Kestrel server boots up we redirect window there.

Shortened code:

var hostApplicationLifetime = host.Services.GetRequiredService<IHostApplicationLifetime>();
hostApplicationLifetime.ApplicationStarted.Register(() =>
{
	var server = host.Services.GetRequiredService<IServer>();
	var addressFeature = server.Features.Get<IServerAddressesFeature>();
	string hostAddress = addressFeature.Addresses.FirstOrDefault();
	if (hostAddress is not null)
	{
		MainPhotinoWindow.Load(hostAddress);
	}
}, useSynchronizationContext: true);

MainPhotinoWindow.Load(path: "LoadingPage.html");

It worked fine earlier, so I started to downgrade Photino.NET to earlier versions and found that it still works with 3.1.15.

So this error starts from Photino.NET version 3.1.16.

@MikeYeager MikeYeager added question Further information is requested All OS labels Oct 24, 2024
@MikeYeager
Copy link
Collaborator

@r-pankevicius Our first thought is, have you tried putting a breakpoint in your ApplicationStarted.Register() code? Does it fire? Does it throw an exception? We're happy to take a look if you have a repo you can share with us that contains the complete code so we can try it out ourselves.

@r-pankevicius
Copy link
Author

r-pankevicius commented Oct 25, 2024

@MikeYeager I've created a simplest example here: https://github.com/r-pankevicius/MyPhotinoApps

SimplePhotinoApp has a ref to Photino.NET v 3.1.16 to show the intended behaviour.

Changing it to 3.1.18 makes app often (not always) to not redirect to web page from "loading" page.

@r-pankevicius
Copy link
Author

BTW ApplicationStarted.Register(callback) is invoked, debugger hit breakpoint, MainPhotinoWindow.Load(hostAddress) was called.

@MikeYeager
Copy link
Collaborator

@r-pankevicius Thank you. We will take a look at this as soon as we get Photino.Samples and project templates updated and published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
All OS question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants