Udostępnij za pośrednictwem


'prefix' is an XML prefix and cannot be used as an expression

'prefix' is an XML prefix and cannot be used as an expression. Use the GetXmlNamespace operator to create a namespace object.

The prefix for an XML namespace that is imported by using the Imports statement cannot be used outside an XML literal.

Error ID: BC30114

To correct this error

  • If you have to refer to part of the imported XML namespace, use the GetXmlNamespace operator to retrieve an XNamespace object. Use that object instead of the XML namespace prefix.

  • If you are using the XML namespace prefix to qualify an XML literal, ensure that you are using appropriate syntax for the XML literal.

See Also

Concepts

Introduction to LINQ in Visual Basic

Reference

Imports Statement (XML Namespace)

GetXmlNamespace Operator

Other Resources

XML Literals

XML in Visual Basic