您也可以在非UWP项目中手动引用UWP库。有关此问题的最新指南是in Microsoft Docs。
简而言之-您需要引用winmd
和C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5
中合适的C:\Program Files (x86)\Windows Kits\10\
库。
- System.Runtime.WindowsRuntime -C:\ Program Files(x86)\ Reference Assemblies \ Microsoft \ Framework.NETCore \ v4.5
- System.Runtime.WindowsRuntime.UI.Xaml -C:\ Program Files(x86)\ Reference Assemblies \ Microsoft \ Framework.NETCore \ v4.5
- System.Runtime.InteropServices.WindowsRuntime -C:\ Program Files(x86)\ Reference Assemblies \ Microsoft \ Framework.NETCore \ v4.5
- Windows.winmd -C:\ Program Files(x86)\ Windows Kits \ 10 \ UnionMetadata \ Facade
- Windows.Foundation.UniversalApiContract.winmd -C:\ Program Files(x86)\ Windows Kits \ 10 \ References \ Windows.Foundation.UniversalApiContract
- Windows.Foundation.FoundationContract.winmd -C:\ Program Files(x86)\ Windows Kits \ 10 \ References \ Windows.Foundation.FoundationContract