Search This Blog

November 5, 2010

Fix the error- System.Xml.Serialization.IXmlSerializable is defined in an assembly that is not referenced.


My environment: Windows 7, VSTS 2010 and SQL Server 2008.

When I try to use ADO.NET to connect to SQL Server 2008, "DataSet myDataSet = new DataSet();" causes the following error.

The type 'System.Xml.Serialization.IXmlSerializable' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

I have "using System.Xml ;" in my source code, but it doesn't work at all. 

After adding reference of System.xml (v4.0.30319), it works.

2 comments:

Anonymous said...

Afteting System.XML.dll as well as System.XML System.Xml.Serialization IT WORKED FOR ME

Run time Version : v4.0.30319

@ Kishore from APEX ONLINE IT TRAINING

Ray said...

Nice to hear :)