Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/259.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# SQLCLR项目的生成错误为';System.Xml.IXmlLineInfo';未在程序集中定义_C#_.net_Sql Server_Visual Studio_Sqlclr - Fatal编程技术网

C# SQLCLR项目的生成错误为';System.Xml.IXmlLineInfo';未在程序集中定义

C# SQLCLR项目的生成错误为';System.Xml.IXmlLineInfo';未在程序集中定义,c#,.net,sql-server,visual-studio,sqlclr,C#,.net,Sql Server,Visual Studio,Sqlclr,我在VS2015中有一个SQLCLR项目,它设置为.NET 4.5.1和SQL Server 2016。它使用System.Xml.Linq 当我构建项目时,会出现如下错误: 在未引用的程序集中定义了类型“System.Xml.IXmlLineInfo” 并建议加载System.Xml 4.0.0 搜索时,我发现一些网站说我必须添加对System.Core的引用,因为它包含System.Xml,所以我这样做了,但仍然得到相同的错误 有什么想法吗?如果您查看文档,它会指出IXmlLineInfo可

我在VS2015中有一个SQLCLR项目,它设置为.NET 4.5.1和SQL Server 2016。它使用
System.Xml.Linq

当我构建项目时,会出现如下错误:

在未引用的程序集中定义了类型“System.Xml.IXmlLineInfo”

并建议加载
System.Xml 4.0.0

搜索时,我发现一些网站说我必须添加对
System.Core
的引用,因为它包含
System.Xml
,所以我这样做了,但仍然得到相同的错误


有什么想法吗?

如果您查看文档,它会指出
IXmlLineInfo
可以在以下位置找到:

程序集:System.Xml.ReaderWriter.dll、System.Xml.dll、netstandard.dll


幸运的是,
System.Xml
System.Xml.Linq
一起出现在列表中,因此添加对它的引用并使其正常工作应该没有问题。

我删除了对System.Xml和System.Core的引用,清理了解决方案,关闭了VS,打开了VS,并添加了System.Xml和System.Core,错误就消失了。错误仍然出现在错误列表中,但不再使生成失败。奇数。

程序集System.Core不包含System.Xml.IXmlLineInfo类型。该类型可在assembly System.Xml中找到。这就是Visual Studio建议您参考System.Xml的原因。