GoDaddy 服务器上未定义 System.Xml.XmlDictionaryReaderQuotas

发布于 2024-10-30 17:50:47 字数 746 浏览 1 评论 0原文

我创建了一些代码来将 JSON HttpWebResponse 分解为 XmlDictionaryReader:

Dim response As HttpWebResponse = request.GetResponse()
Dim xmlQuotas As New Global.System.Xml.XmlDictionaryReaderQuotas
Dim yelpJson As System.Xml.XmlDictionaryReader = System.Runtime.Serialization.Json.JsonReaderWriterFactory.CreateJsonReader(response.GetResponseStream(), xmlQuotas)

一切在我的本地计算机以及另一台远程服务器上运行良好,但是,当我将其移至我的 GoDaddy 托管帐户时,我得到以下信息错误:

Compiler Error Message: BC30002: Type 'System.Xml.XmlDictionaryReaderQuotas' is not defined.

这似乎是标准类型,所以我不知道为什么它不会被定义,并且它似乎在我的本地计算机和另一个远程服务器上都没有问题。

有谁知道吗: a) 什么会导致这个或 b) 如何解决它以在我的 GoDaddy 服务器上运行?

除了重新创建整个 XmlDictionaryReaderQuotas 类型之外,我已经尝试了所有方法。

I've got some code I created to break down a JSON HttpWebResponse into a XmlDictionaryReader:

Dim response As HttpWebResponse = request.GetResponse()
Dim xmlQuotas As New Global.System.Xml.XmlDictionaryReaderQuotas
Dim yelpJson As System.Xml.XmlDictionaryReader = System.Runtime.Serialization.Json.JsonReaderWriterFactory.CreateJsonReader(response.GetResponseStream(), xmlQuotas)

Everything works great on my local machine, as well as on another remote server, however, when I move this to my GoDaddy hosting account, I get the following error:

Compiler Error Message: BC30002: Type 'System.Xml.XmlDictionaryReaderQuotas' is not defined.

This seems to be a standard type, so I don't know why it wouldn't be defined and it seemed to work without issue on both my local machine as well as another remote server.

Does anybody know either:
a) what would cause this or
b) how I can resolve it to work on my GoDaddy server?

I've tried everything short of recreating the entire XmlDictionaryReaderQuotas type.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

独行侠 2024-11-06 17:50:47

永远无法弄清楚这一点,所以我继续摆脱 XmlDictionaryReader 和 XmlDictionaryReaderQuotas。相反,我使用 JavaScriptSerializer 将所有内容反序列化为 Dictionary(Of String, Object) 类型,然后使用一些自定义函数对其进行爬行以返回我需要的任何值。

Dim yelpReader As IO.StreamReader = New IO.StreamReader(yelpResponse.GetResponseStream())
Dim JsonSerializer As New Web.Script.Serialization.JavaScriptSerializer()
Dim JsonData As Dictionary(Of String, Object) = CType(JsonSerializer.DeserializeObject(yelpReader.ReadToEnd), Dictionary(Of String, Object))

Never could figure this out, so I went ahead and got rid of the XmlDictionaryReader and XmlDictionaryReaderQuotas. Instead I used a JavaScriptSerializer to deserialize everything into a Dictionary(Of String, Object) type, then crawled through it using some custom functions to return whatever value I need.

Dim yelpReader As IO.StreamReader = New IO.StreamReader(yelpResponse.GetResponseStream())
Dim JsonSerializer As New Web.Script.Serialization.JavaScriptSerializer()
Dim JsonData As Dictionary(Of String, Object) = CType(JsonSerializer.DeserializeObject(yelpReader.ReadToEnd), Dictionary(Of String, Object))
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文