XmlDocument在当前上下文中不存在

时间:2015-01-07 21:09:00

标签: visual-studio-2013 reference windows-applications

我在代码中引用了System.Xml,但XmlDocument仍未显示。每当我尝试使用它时,它会告诉我:

Error: The type or namespace name 'XmlDocument' could not be found (are you missing a
using directive or an assembly reference?)

我看到this link似乎很有帮助;不幸的是,我使用的是Windows Apps模板,它不允许我删除或添加引用,我确信我没有使用Silverlight。我正在使用.NET 4.5的Visual Studio 2013。任何帮助表示赞赏。

编辑:我正在尝试制作后台任务。这就是我使用它的方式:

XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(toastTemplate);

1 个答案:

答案 0 :(得分:1)

我明白了:库已被更改或其他内容,因此XmlDocument不再属于System.Xml。 它现在在Windows.Data.Xml.Dom。

这有效:

using Windows.Data.Xml.Dom;
相关问题