Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't resolve XmlDictionaryWriter?

Tags:

c#

.net

xml

vb.net

I have some VB.NET code that I am converting to C#. It uses XmlDictionaryWriter and XmlDictionaryReaderQuotas both of which, according to MSDN are in System.Xml and in the assembly System.Runtime.Serialization. I added System.Runtime.Serialization as a reference. It keeps saying they cannot be found. Here is the VB.NET code:

Dim xmlreader As System.Xml.XmlDictionaryReader

Dim quotas As New System.Xml.XmlDictionaryReaderQuotas

xmlreader = JsonReaderWriterFactory.CreateJsonReader(result, quotas)

This is in VS2013/.NET Framework 4

like image 288
user2471435 Avatar asked Nov 08 '13 18:11

user2471435


2 Answers

Adding a reference to System.Runtime.Serialization should do the trick.

like image 189
Aage Avatar answered Sep 26 '22 01:09

Aage


Right click on your References folder under Project and add Reference, left side under Assembly click Framework then right side search box type System.Runtime.Serialization, check the check box and click add. It should get add into your project. In .cs file add using System.Runtime.Serialization should solve your problem.

enter image description here

like image 45
Jaydeep Shil Avatar answered Sep 26 '22 01:09

Jaydeep Shil