开发者

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

I have a solution which contains a few projects, one being a web sevrice, the others being class libraries. I want to use Xdocuments in both the web service and one of the class libraries, so i have added a reference to System.xml.Linq in solution explorer, and included it within the relevant .cs files by using System.Xml.Linq. This is also reference in the web.config as follows:

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

Which is in the assemblies tag.

But when i fire a request at the service i get the response below before it even gets into the service. The problem is with the having the reference in the class library, as i have taken it out to test. I am not sure what is wrong. Can anyone please 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=b开发者_StackOverflow77a5c561934e089'.

Thanks in advance.


My first idea would be in this case to check if target framework is set correctly in the projects. To do this right click Your projects in Solution explorer, select properties and verify the target framework setting on the application tab.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜