Skip to content

windows-reactor as_self_contained() + bootstrap() fails with STATUS_DLL_NOT_FOUND (missing MddBootstrapInitialize2) #4692

Description

@Matuco19

Summary

A minimal windows-reactor application created from scratch fails to start when using windows_reactor_setup::as_self_contained() in build.rs and bootstrap()? in main(). The executable builds successfully, but immediately exits with:

error: process didn't exit successfully: `target\debug\wahnote.exe` (exit code: 0xc0000135, STATUS_DLL_NOT_FOUND)

Opening the executable with Dependencies shows that the missing import is MddBootstrapInitialize2 from Microsoft.WindowsAppRuntime.Bootstrap.dll, and interestingly, there are two configurations that work:

// build.rs
fn main() {
    windows_reactor_setup::as_framework_dependent();
}

with

// main.rs
fn main() -> Result<()> {
    bootstrap()?;
    App::new().title("example").render(app)
}
// build.rs
fn main() {
    windows_reactor_setup::as_self_contained();
}

with

// main.rs
fn main() -> Result<()> {
    App::new().title("example").render(app)
}

The only configuration that fails is:

// build.rs
fn main() {
    windows_reactor_setup::as_self_contained();
}

combined with

// main.rs
fn main() -> Result<()> {
    bootstrap()?;
    App::new().title("example").render(app)
}

This makes me think there is either: a packaging issue in as_self_contained(), or bootstrap() should not be used for self-contained deployments and the documentation should mention this (but since it hasn't been published to crates.io (as mentioned here yet, it seems like something undone).

I think that as_self_contained() should produce a working executable when used together with bootstrap(), or bootstrap() should not be required (or should become a no-op) for self-contained deployments, and this should be documented.

It is also worth noting that the windows-reactor Getting Started example itself in documentation can reproduce this error, as as_self_contained() + bootstrap()?; is being used.

Environment

  • OS: Windows 11 Pro Insider Preview
  • Build: 10.0.26200
  • Rust: stable (rustc 1.97.0 (2d8144b78 2026-07-07))
  • windows-reactor: git (current main, commit 07f344c019b8fdae4d398d4c2591596044cb416a)
  • windows-reactor-setup: git (current main, commit 07f344c019b8fdae4d398d4c2591596044cb416a)

An additional info is that my machine has multiple versions of the Windows App Runtime installed (including 2.x), but i don't see why this would be the problem, the issue appears to be specific to the combination of self-contained deployment + explicit bootstrap.

Crate manifest

[package]
name = "wahnote"
version = "0.1.0"
edition = "2024"

[dependencies]
windows-reactor = { git = "https://github.com/microsoft/windows-rs" }

[build-dependencies]
windows-reactor-setup = { git = "https://github.com/microsoft/windows-rs" }

Crate code

main.rs:

use windows_reactor::*;

fn main() -> Result<()> {
    bootstrap()?;
    App::new().title("WahNotepad").render(app)
}

fn app(_cx: &mut RenderCx) -> Element {

    vstack((
        text_box("")
            .height(500.0)
            .header("New Note")
            .width(400.0),

    ))
    .into()
}

build.rs:

fn main() {
    windows_reactor_setup::as_self_contained();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions