如何添加对 Windows 通用 C++ 项目的引用

How do I add a reference to a Windows Universal C++ project

我是 windows 通用应用程序和 Visual Studio 2015 项目的新手,我找不到如何添加对 C++ 项目的引用。我想使用 LINQ,但找不到命名空间 System.Linq。

在解决方案资源管理器中右键单击 "References",然后在弹出菜单中单击 "Add reference"。这将打开参考资料管理器,您可以在其中 select 您需要的参考资料。您可以在 this MSDN article.

中阅读有关该主题的更多信息

[]2

默认情况下,您无需添加对 'System.Linq' 的额外引用。只需添加 using System.Linq;

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

I can't find how to add a reference to the C++ project. I want to use LINQ and the namespace System.Linq can't be found.

您不能将 .NET 程序集 LINQ 引用到 UWP C++ 项目。您只能引用 UWP Windows 运行时组件。