Skip to content

[Bug]: Wrong instruction in Build MCP #223

Open

Description

@rabbitism

Describe the bug

This is not valid in for latest DevTools, they cannot co-exist

Content from : Avalonia DevTools — Setup & Migration

Step 5 — Configure Program.cs

Ensure .WithDeveloperTools() is called in the BuildAvaloniaApp() method in Program.cs. Add it if missing:

public static AppBuilder BuildAvaloniaApp()
    => AppBuilder.Configure<App>()
        .UsePlatformDetect()
        .WithDeveloperTools()
        .LogToTrace();

Step 6 — Configure App.axaml.cs

Ensure AttachDeveloperTools() is called in the Initialize() method of App.axaml.cs, inside an #if DEBUG block, after AvaloniaXamlLoader.Load(this);. Add it if missing:

public override void Initialize()
{
    AvaloniaXamlLoader.Load(this);
#if DEBUG
    this.AttachDeveloperTools();
#endif
}

Both Step 5 and Step 6 are required. .WithDeveloperTools() enables the DevTools infrastructure; AttachDeveloperTools() connects to the DevTools instance.

To Reproduce

Product(s)

DevTools

Platform

Windows

License Tier

Community

Avalonia version

12.0.2

Tool/Control Version

No response

Relevant log output

Additional context

No response

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions