简体   繁体   English

如何制作 UWP class 库以支持 WindowsAppSdk 应用程序

[英]how to make UWP class library to support WindowsAppSdk apps

I have developed a UWP class library , and it is already used in various projects.我开发了一个UWP class 库,它已经在各种项目中使用。

Now I want to make this UWP class library to support WindowsAppSdk apps too.现在我想让这个 UWP class 库也支持WindowsAppSdk应用程序。

When I try to refer UWP Library in WindowsAppSdk app, getting error like " Project is not compatible ".当我尝试在 WindowsAppSdk 应用程序中引用 UWP 库时,出现类似“项目不兼容”的错误。

My UWP class library min supported version - Windows 10 fall creators update (16299) .我的 UWP class 库最小支持版本 - Windows 10 秋季创作者更新 (16299)

Should I recreate my UWP Library as WindowsAppSdk library?我应该将我的 UWP 库重新创建为 WindowsAppSdk 库吗?

Can anyone help me understand this谁能帮我理解这个

Thanks Noorul.谢谢诺鲁尔。

Should I recreate my UWP Library as WindowsAppSdk library?我应该将我的 UWP 库重新创建为 WindowsAppSdk 库吗?

No, but you should convert it into a .NET Standard library that can be consumed by both UWP and WinUI (.NET) applications, and any other type of application whose runtime implementation supports the version of the .NET Standard specification that you choose to target.不,但是您应该将其转换为 UWP 和 WinUI (.NET) 应用程序,以及运行时实现支持您选择的 .NET 标准规范版本的任何其他类型的应用程序都可以使用的.NET 标准库。

UWP apps cannot consume librararies that are targeted against a specific platform such as .NET and vice versa. UWP 应用程序无法使用针对特定平台(例如 .NET)的库,反之亦然。 That's where .NET Standard comes in. It enables you to share code across multiple .NET implementations and platforms.这就是 .NET 标准的用武之地。它使您能够跨多个 .NET 实现和平台共享代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM