#4933·windows-rs

[win32metadata] Allow configuring RDL assembly identity

Author: jevansaksCreated Sep 15, 2026Updated Sep 15, 2026
Labelsquestion

Summary

The RDL reader writes a WinMD with a fixed/default assembly identity. A caller generating a named metadata assembly needs to set its assembly name and four-part version.

Standalone repro

Compile this RDL:

rust
#[win32]
mod Test {
    struct Value {
        value: i32,
    }
}

Configure the requested identity as Contoso.Metadata, version 1.2.3.4, then reopen the emitted WinMD with windows-metadata. The assembly row should report that exact name and version.

Focused test:

crates/tests/libs/rdl/tests/errors.rs::assembly_identity_can_be_configured

win32metadata impact

Header scraping succeeds, but the produced Windows.Win32.winmd has the wrong assembly identity. This is not a partition compilation blocker, but it prevents the Rust pipeline and the Microsoft.Windows.WinmdGenerator package from producing a compatible deliverable.

Candidate fix

Expose assembly name/version on the RDL reader and pass them to the metadata writer.

Tested fix: https://github.com/jevansaks/windows-rs/commit/3355512fea66f9118299f070a43dd2ea7105b7f7