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

Hot design missing when appBuilder (on linux) #5

Open
sarosigy opened this issue Dec 12, 2024 · 3 comments
Open

Hot design missing when appBuilder (on linux) #5

sarosigy opened this issue Dec 12, 2024 · 3 comments
Labels
kind/bug Something isn't working tool/Hot Design™

Comments

@sarosigy
Copy link

Current behavior

I just created a brand new Uno desktop app, it runs as it should.

I wanted to leverage the Localization which means using Hosting, also. I did exactly what is written in Uno Howto Hosting Setup

But even adding the single line var appBuilder = this.CreateBuilder(args); causes two things:

  1. The Hot Design toolbar won't show on the Main Window
  2. The application would not exit by closing with the Close button, it must be stopped in debugger (or its process killed)

Expected behavior

It should work as expected.

How to reproduce it (as minimally and precisely as possible)

  1. dotnet new unoapp --platforms desktop -o unoinout
  2. Add Hosting to <UnoFeatures>
  3. Add the line var appBuilder = this.CreateBuilder(args); in the first line of App.xaml.cs protected override void OnLaunched(LaunchActivatedEventArgs args)

Workaround

Not using appBuilder.

Which tool(s) are affected?

Hot Design™

Affected platforms

Desktop (Skia)

Uno.Sdk version

5.5.54

IDE used

Visual Studio Code on Linux

IDE version

1.96.0

Uno Platform Extension version

0.18.5

Relevant plugins

No response

Anything else we need to know?

No response

@sarosigy sarosigy added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification. labels Dec 12, 2024
@nickrandolph
Copy link

@sarosigy thanks for raising this, we'll investigate this

@nickrandolph nickrandolph removed the triage/untriaged Indicates an issue requires triaging or verification. label Dec 17, 2024
@nickrandolph
Copy link

@sarosigy which version of the uno.sdk are you using (look in global.json)?

When I follow the steps you provided, I also adjusted the next two lines of the code:

  • use the Window property on the builder to retrieve the Window instance used by hosting
  • call UseStudio (in some older templates this was EnableHotReload)
    image

Let me know if this helps

@sarosigy
Copy link
Author

sarosigy commented Jan 7, 2025

At that time the SDK was the latest,
"Uno.Sdk": "5.5.54"

I have the UseStudio line, it came with the template.

However, the

MainWindow = appBuilder.Window;

line helped. Now it works, the toolbar is in place.

So, it seems it is a documentation issue, because at the Hosting (Hosting) it gives this as an example:

protected override void OnLaunched(LaunchActivatedEventArgs e)
{
    var appBuilder = this.CreateBuilder(args)
    .Configure(host => {
        // Configure the host builder
    });

    Host = appBuilder.Build();
    ...
}

And at the Localization (Localization):

protected override void OnLaunched(LaunchActivatedEventArgs e)
{
    var appBuilder = this.CreateBuilder(args)
        .Configure(host =>
        {
            host.UseLocalization()
        });
    ...
}

Unfortunately the

MainWindow = appBuilder.Window;

part is missing from both places, and while the application works (or it seems to be working at least), it breaks the Hot Design.

If you don't need this issue remain open (to fix documentation) you may close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working tool/Hot Design™
Projects
None yet
Development

No branches or pull requests

3 participants