System.Xml.XmlDictionaryReaderQuotas not defined on GoDaddy server
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.XmlDicti开发者_C百科onaryReader = 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.
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))
精彩评论