vb.netxml-literals

Tauntalizing vb.net error: XML literals and XML axis properties are not available, as a required reference was not provided


So I put some code like this in my legacy vb.net app (just upgraded from framework 2.0 to 4.0 - so missing default references):

    eag.stAgentXML = _
       <Agent>
         <Number><%= (CaseRoot.AgentForCase.State.PadLeft(4, "0"c) & " " & _
                   CaseRoot.AgentForCase.Number.PadLeft(4, "0"c) & "-" & _
                   CaseRoot.AgentForCase.Rank) %></Number>
         <Name><%= CaseRoot.AgentForCase.LastName & ", " & CaseRoot.AgentForCase.FirstName %></Name>
       </Agent>.Value

And it gives me this extremely helpful message:

XML literals and XML axis properties are not available, as a required reference was not provided

Who, on the vb.net team, can I scream at for not going the last millimeter and actually telling me which reference to include?

Why didn't they just tell me how they really felt, and make the error message read, "Nice try but this code is wrong. good luck."

Oh - and I would not mind knowing how to make it actually work.


Solution

  • Add references to System.Xml, System.Xml.Linq, and System.Core.

    Taken from MSDN documentation