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

自闭症网瘾萝莉.ら 提交于 2019-12-11 18:35:27

问题


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.


回答1:


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

Taken from MSDN documentation



来源:https://stackoverflow.com/questions/28654059/tauntalizing-vb-net-error-xml-literals-and-xml-axis-properties-are-not-availabl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!