Skip to content
This repository has been archived by the owner on Aug 24, 2022. It is now read-only.

Where do the winmd files come from? (besides the generated one) #40

Closed
jesdazrez opened this issue May 17, 2022 · 4 comments
Closed

Where do the winmd files come from? (besides the generated one) #40

jesdazrez opened this issue May 17, 2022 · 4 comments
Labels
question Further information is requested

Comments

@jesdazrez
Copy link

Hi! I have some questions regarding how the fns are generated, specifically for the XAML part of it.

I've been playing with the metadata generator project and now I'm able to generate the Microsoft.WindowsAppSdk.Generated.winmd file.
However, I wonder where do the rest of the winmd files in the .windows/winmd folder come from 🤔. Are those also generated?

I got into generating my own bindings due to the reduced API surface of the windows-rs crate (microsoft/windows-rs#1715) so I just set the min_xaml option to false. That helped and now I can call some more methods like SetContent but I can't seem to find others like Windows::new.

So, in fewer words:

  • Are the APIs published in this package under UI::Xaml substantially different from those in windows-rs (even with min_xaml disabled)?
  • How/Where can I get the mentioned winmd files?
  • Can we have some docs in how to use WinUI 3 from Rust with just windows-rs?
    • I know now we have this amazing crate (windows-app-rs) that simplifies the process, but I think documenting how it works will help people who are trying to experiment with it, use newer preview versions of the WindowsAppSDK or just tweaking it.
@riverar riverar added the question Further information is requested label May 17, 2022
@riverar
Copy link
Collaborator

riverar commented May 17, 2022

Hi @jesdazrez! I'm still in the process of documenting the overall concept (from header to Rust crate, start to finish) but to answer your specific questions:

  • Are the APIs published in this package under UI::Xaml substantially different from those in windows-rs (even with min_xaml disabled)?
  • How/Where can I get the mentioned winmd files?

All the other metadata in .windows/winmd is specific to the Windows App SDK and ships in its NuGet package.

  • Can we have some docs in how to use WinUI 3 from Rust with just windows-rs?

It is not possible to use WinUI 3 from Rust with just windows-rs. You'll need to generate all the bindings, then worry about bootstrapping, manifestation, etc. which basically just recreates this crate. (Anything in the XAML namespace is basically unsupported by both crates. You won't get very far without XAML code generation or XAML compilation, I'm afraid.)

@jesdazrez
Copy link
Author

Thanks for the answer @riverar!
I have setup the bootstrapping part of the app and it's working as expected.
I see some of the files (e.g. Microsoft.Foundation) are present in both lib/uap10.0.17763 and lib/uap10.0.18362. I'm guessing I should use the ones depending on the least Windows version I want to target? So for example the one under uap10.0.17763 if I want to target Windows 10 1809 and up?

@riverar
Copy link
Collaborator

riverar commented May 18, 2022

Yup that's right. Some features only support version Y and up.

@jesdazrez
Copy link
Author

Ok, thanks for all the help!

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

No branches or pull requests

2 participants