在 c# 中出现关于未引用 System.XML 的编译错误,是的 System.XML 正在被引用 [英] Getting a compile error in c# about not referencing System.XML, yes System.XML is being reference
问题描述
我正在尝试为我编写的旧程序添加新功能.但是,当尝试在 VS express 中构建程序时,它向我返回了一条错误消息.
I am trying to add a new feature to an old program I wrote. However, when trying to get the program to build in VS express it spits back an error message to me.
错误 1 类型System.Xml.Serialization.IXmlSerializable"是在未引用的程序集中定义.你必须添加一个参考程序集System.Xml,版本=4.0.0.0,文化=中性,PublicKeyToken=b77a5c561934e089'.C:PathToFilesummaryForm.cs 101 18串行控制器
Error 1 The type 'System.Xml.Serialization.IXmlSerializable' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. C:PathToFilesummaryForm.cs 101 18 SerialController
但是这个东西在cs文件的顶部,它有
However the thing is at the top of the cs file, it has
using System;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
using System.Xml;
有什么想法为什么不能识别 XML 引用?
Any ideas whyits not recognizing the XML reference?
推荐答案
使用命名空间并不意味着您引用了某些内容.您需要添加一个引用到System.XML
.
Using a namespace does not mean you referenced something. You need to add a reference to System.XML
.
如果您使用的是 Visual Studio,请右键单击引用,单击添加引用,然后选择 System.XML
.
If you are using Visual Studio, right click on references, click Add Reference and then select System.XML
.
这篇关于在 c# 中出现关于未引用 System.XML 的编译错误,是的 System.XML 正在被引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!