user2471435
user2471435

Reputation: 1674

Can't resolve XmlDictionaryWriter?

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

Upvotes: 5

Views: 4197

Answers (2)

Jaydeep Shil
Jaydeep Shil

Reputation: 1959

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

Upvotes: 5

Aage
Aage

Reputation: 6252

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

Upvotes: 10

Related Questions