Michael Ray Lovett
Michael Ray Lovett

Reputation: 7050

Is System.Xml.XPath supported in .NET core 1.0? VS 2015 doesn't think so

I'm trying to port a library from .Net 4.x to .Net core 1.0 and one error (of many) that I'm getting in VS 2015 is that "XPath" is not part of the System.Xml namespace. (Ie: this using statement fails: using System.Xml.XPath)

Yet when I look in the spec for NetStandard.Library 1.6, it looks like it's still part of the spec:

https://github.com/dotnet/corefx/tree/master/src

What's going on?

Michael

Upvotes: 2

Views: 1660

Answers (2)

Thomas
Thomas

Reputation: 5240

There is some confusion here.

  • The provided link is the list of source code roughly reflecting the class library programmed as part of the .NET Core (xplat) implementation. However, this does not reflect the netstandard contract or the NETStandard.Library in a 1:1 relationship. There are platform-agnostic libraries in it (for example System.Buffers) which are not part of the ".NET Platform Standard" and on the other hand libraries which are only useful for .NET Core (some of these: https://www.nuget.org/packages/Microsoft.NETCore.App/).
  • The System.Xml.XPath namespace is implemented in System.Xml.Xpath library/NuGet on top of netstandard1.3+. Therefore, it is available as a platform agnostic assembly.
  • The netstandard covers a set of API which are required to be implemented by a .NET Platform (like .NET Core, .NET Framework, Mono, Xamarin, and hopefully in future Unity3D). On top of them, there are countless libraries which platform agnostic (like System.Xml.XPath or System.Collections.Immutable). Confusingly, these count also as part of the ".NET Standard Library". However, the meta package NETStandard.Library covers in my humble opinion only the contracted part of the netstandard but not the agnostic libraries on top.

BCL Library

For System.Xml.XPath this makes somehow all sense. It is a kind of deprecated API which is not an element of a ".NET Platform Standard" (which is a strict requirement for .NET implementations) but still available as part of the ".NET Standard Library" available for everyone on every platform to use.

Upvotes: 3

Set
Set

Reputation: 49779

You should add dependency to System.Xml.XPath.

Upvotes: 1

Related Questions