Skip to content

Conversation

@JesseCol
Copy link
Contributor

Problem: I'd like to write Javascript against WinAppSdk projection assemblies, but some of the types cause the metadata parser to throw a "NotSupportedException", apparently because they accept pointers.

Proposed Solution: This is a proposed PR to add an API to allow a consumer project to tell the node-api-dotnet generator to exclude certain types (with wildcard match) by setting a NodeApiExcludeFromMetadata property.

Here we exclude a few different types and namespaces:

 <NodeApiExcludeFromMetadata>ABI.*;WinRT.IInspectable+Vftbl*;WinRT.Interop.IUnknownVftbl*</NodeApiExcludeFromMetadata>

This PR also adds an example/winappsdk dir that shows how a nodejs app can use node-api-dotnet to call WinAppSDK WinRT APIs.

@JesseCol JesseCol force-pushed the exclude-from-metadata branch from 57a3747 to 54c2e8f Compare October 16, 2025 19:33
Copy link
Member

@jasongin jasongin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thanks!

There are some nuget package issues that break the PR build, which I will fix in the package feed.

@jasongin jasongin merged commit 50d4991 into microsoft:main Oct 16, 2025
25 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants