How to consume a winrt/c++ lib in WinUI3 Application

Damon Pan 86 Reputation points
2023-08-17T06:23:05.85+00:00

Hi MSFT team,

I am trying to consuming a winrt/C++ library (xxx.dll, xxx.winmd) in my application created by VS2022.

  • If I create UWP/C# application, it's easy to add the reference by: "right click project" -> Add -> reference -> Browse -> "then choose the winmd file" Then it works well.
  • But if I create WinUI3/C# application, there is no such option to add such reference.
  • User's image

Since I must use WinUI3 App, so Could you please help on how to consume a winrt/c++ lib in WinUI3 Application?

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
878 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,449 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
11,489 questions
{count} votes

1 additional answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.