简体   繁体   中英

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

I am new on windows universal apps and Visual Studio 2015 projects and 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.

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.

You cannot reference a .NET assembly LINQ to a UWP C++ project. You can only reference the UWP Windows Runtime Component to it.

Right-click on "References" in the solution explorer, and click "Add reference" in the pop-up menu. That will open the reference manager where you can select the reference you need. You can read more about the topic in this MSDN article .

[ 在此处输入图片说明 ] 2

You No need to add additional reference to 'System.Linq' by default it is there. just add 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;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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