Linq to XML 需要 VB.NET XML 文字表达式
我遇到了与这个问题中所述相同的问题,但已接受解决方案有一个“在我的机器上工作”的答案。
这是我的代码:
Dim document As XDocument = _
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<GetUser xmlns="http://foo.com/bar.asmx">
<encryptedHash>HashString</encryptedHash>
<accessKey>AccessString</accessKey>
<siteUID>SiteString</siteUID>
</GetUser>
</soap12:Body>
</soap12:Envelope>
我收到错误:BC30201:需要表达式。
有谁对可能导致这种情况的原因有更详细的了解?
I have the same problem as stated in this question, but the accepted solution there was a "works on my machine" answer.
Here is my code:
Dim document As XDocument = _
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<GetUser xmlns="http://foo.com/bar.asmx">
<encryptedHash>HashString</encryptedHash>
<accessKey>AccessString</accessKey>
<siteUID>SiteString</siteUID>
</GetUser>
</soap12:Body>
</soap12:Envelope>
And I receive the error: BC30201: Expression expected.
Does anyone have a more detailed idea of what could cause this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,Rubber Duck 调试——
即使项目设置为面向 .NET 3.5,对于无论 web.config 丢失的原因是什么:
所以我猜它没有在 3.5 中运行。一旦我将上述内容添加到 web.config 中,它就会编译。
Ok, Rubber Duck debugging --
Even though the project was set to target .NET 3.5, for whatever reason the web.config was missing:
So I guess it wasn't running in 3.5. As soon as I added the above to the web.config it compiled.