Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SvcUtil and 'System.Xml.Linq.XElement' cannot be converted to 'System.Xml.XmlElement' compiler error

I always recieve the above error when I generate a proxy class for my service using SvcUtil. The service is exposing a property that is of System.Xml.Linq.XElement type. The SvcUtil generates a System.Xml.XmlElement type property unfortunately. On the other hand if I'm using Add Reference in VS to generate the proxy class, everything's ok. I tried the latest 4.0 version of SvcUtil from the NETFX 4.0 Tools folder, but still with no luck.

like image 384
odehne Avatar asked Oct 19 '10 08:10

odehne


1 Answers

In case anyone is still looking, like I was, the answer is here: http://social.msdn.microsoft.com/Forums/en/wcf/thread/42dbe820-3f59-4662-9664-83999e1746c0

Yaron Naveh suggests adding a /reference argument to SvcUtil.exe.

svcutil /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" http://localhost...

like image 135
Felipe Avatar answered Sep 25 '22 11:09

Felipe