如何找出要将哪个程序集添加到包含命名空间 System.Windows.Xps.Packaging 的 .Net Core 3 Preview 6 应用程序?

How to find out which assembly to add to .Net Core 3 Preview 6 app that contains the namespace System.Windows.Xps.Packaging?

我无法在 .Net Core 3 Preview 6 中引用 System.Windows.Xps.Packaging,尽管它在 Microsoft .Net Api Browser.

中列出

我正在迁移一个读取 xps 文件的 .Net 4.5 应用程序,基于这个堆栈溢出问题 Extract text from a XPS Document。在 .Net 4.5 中,我必须引用 ReachFrameworkWindowsBase 才能使 System.Windows.Xps.Packaging 可用。

所以我最好的猜测是 .Net Core 3 Preview 6 System.Windows.Xps.Packaging 命名空间隐藏在一些未明确命名的程序集中 System.Windows.Xps.Packaging并且不再命名为 ReachFrameworkWindowsBase,但是我找不到要添加到我的 .Net Core 3 Preview 6 应用程序中的所需程序集。

如何找出要添加到我的 .Net Core 3 Preview 6 应用程序中的程序集,其中包含命名空间 System.Windows.Xps.Packaging

在 .Net Core 3 预览版 6 中,ReachFramework 是 WPF (see the source code on GitHub) 的一部分。如果您创建一个新的 WPF 项目 (dotnet new wpf) 并添加 using System.Windows.Xps.Packaging;,那么您可以插入您提到的堆栈溢出问题中的代码,并且编译时不会出现错误。但是,如果您创建了另一种项目类型(例如控制台),它将不起作用。

GitHub 上有一个未解决的问题,我对您感兴趣:Cross platform support for XPS