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

1

0

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.

Photoluminescence answered 22/2, 2015 at 3:10 Comment(0)
S
3

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

Taken from MSDN documentation

Suppressive answered 22/2, 2015 at 3:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.