System.Xml.Linq.XDocument 'is defined in an assembly that is not referenced

I have a solution that contains several projects, one of which is web sevrice, and the other is class libraries. I want to use Xdocuments both in the web service and in one of the class libraries, so I added a link to System.xml.Linq in the solution explorer and included it in the corresponding .cs files using System.Xml.Linq. This is also a link in web.config as follows:

<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

What is in the assembly tag.

But when I run the request in the service, I get the answer below before it even gets into the service. The problem is that I have a link in the class library since I decided to test it. I'm not sure what is wrong. Can anyone help?

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

Thanks in advance.

+3
1

. Solution explorer, .

0

All Articles