最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】C#项目编译出错:error CS0103: The name ‘WhitespaceHandling’ does not exist in the current context

C# crifan 6588浏览 0评论

【问题】

C#中用代码:

sgmlReader.WhitespaceHandling = WhitespaceHandling.All;

结果编译出错:

error CS0103: The name ‘WhitespaceHandling’ does not exist in the current context

 

【解决过程】

1.google搜WhitespaceHandling找到:

http://msdn.microsoft.com/zh-cn/library/system.xml.whitespacehandling%28v=vs.80%29.aspx

所以去添加:

using System.Xml;

然后就解决了。

 

【总结】

WhitespaceHandling是System.Xml的枚举变量。所以加上引用,即可。

转载请注明:在路上 » 【已解决】C#项目编译出错:error CS0103: The name ‘WhitespaceHandling’ does not exist in the current context

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
84 queries in 0.161 seconds, using 22.19MB memory