简体   繁体   中英

Can't find XDocument and XElement

I'm trying to parse an xml and I want to get access to either XDocument or XElement . Those 2 classes currently don't exist.

I'm using Visual Studio. Am I suppose to add a reference? I currently have System.Xml.linq selected but I still can't access the 2 classes above...

在此处输入图像描述

You need the System.Xml.XDocument.dll for XDocument and XElement .

See the docs :

在此处输入图像描述

If you don't have that dll on your system, you could install the System.Xml.XDocument NuGet package.

Install-Package System.Xml.XDocument -Version 4.3.0

PS: To read more how to install NuGet packages in Visual Studio, check Quickstart: Install and use a package in Visual Studio

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