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.
SvcUtil and 'System.Xml.Linq.XElement' cannot be converted to 'System.Xml.XmlElement' compiler error
Asked
Active
Viewed 1,127 times
6
-
2You should not be exposing a .net specific type like this in a datacontract. Why not generate a strongly typed class for the xml structure or just expose a string? – Paul Hiles Jan 10 '11 at 14:49
-
Did you ever figure this out. I am also running into this with a service passing back a Drawing object. – runxc1 Bret Ferrier Dec 05 '11 at 23:26
1 Answers
2
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...

Felipe
- 144
- 1
- 3
- 11