Replies: 4 comments
-
There are a few ways in which the WinMD files might be used at runtime. We've always required them to be present in UWPs in part to support tooling in the store submission pipeline, and in part for use at runtime. Here are a few ways the metadata might be used at runtime:
That's a pretty long answer. In short, you might get away with removing it. It's used very narrowly in practice. But there's some runtime variability in behavior, esp. with async completion and how delegates are called back, that could lead to things working sometimes or most of the time. Async completion can be called back synchronously if the delegate is assigned after the async operation completes. This means that you might not see marshalling on a fast dev machine, but on a more constrained piece of hardware those same operations may actually complete asynchronously and require marshalling of the delegate. Unless you're extremely concerned about size, it's better to have the metadata present. It's usually not large, and having it present removes the chance of hitting difficult-to-reproduce failures. Unfortunately, there's no deterministic way to test whether you actually need it. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Did some research, it seems like for C++ projects, the generated .pri file already has the XBF inside of it (checked with |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm opening this since I suspect we need more detailed documentation on this topic.
Discussed in #2001
Originally posted by AzAgarampur January 21, 2022
After building my unpackaged app in Release, there are some files in the release directory that seem to be used only when creating MSIX packages, not unpackaged apps. I already deleted the .pdb and linker files because they are unnecessary, but what about the .winmd files and .pri files?
For a test, create an unpackaged app using the directions on microsoft docs. Build in release, then remove the pdb and extra linker files. Then, delete everything except the .XBF files. Run the program, and notice how it runs the same compared to if the files were present.
Is this safe to do, and in what situations will we need those other files?
On the other hand, is there a way for .XBFs to be merged into our app the same way they are merged if you are publishing a C++/WinRT or C# UWP app?
Beta Was this translation helpful? Give feedback.
All reactions