我有WCF服务,当我更新服务引用时,显示" system.xml"在以下代码中
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.18408")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
但我想改变&#34; system.xml&#34;到&#34; System.Runtime.Serialization&#34;如下图所示。
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
我该如何改变呢?是否有任何WCF设置可以更改此内容?
谢谢,
答案 0 :(得分:1)
检查您是否在DataContract或OperationContract中使用了特殊类型。我以前遇到过这个问题,原因是我在数据合同中使用了DataTable。
答案 1 :(得分:0)
我找到了解决方案。它发生了,因为项目使用Document.OpenXml作为参考。现在删除对项目的引用后,它使用运行时序列化程序
谢谢......:D