私はWCFサービスライブラリを構築しましたが、私はいくつかのサードパーティのDLLに参照を追加しました。これは私のインターフェイスですWCFサービスライブラリの実行中にエラーが発生しました
[ServiceContract]
public interface IService1
{
[OperationContract]
3rdpartyreturntype GetObj(System.Windows.Controls.Control txtcontrol);
}
// Use a data contract as illustrated in the sample below to add composite types to service operations
[DataContract]
public class nclass
{
[DataMember]
public System.Windows.Controls.Control txtcontrol
{
get { return txtcontrol; }
set { txtcontrol = value; }
}
[DataMember]
public 3rdpartyreturntype nobj
{
get { return vuiobj; }
set { vuiobj = value; }
}
[DataMember]
public System.Windows.Input.TouchDevice tchdev
{
get { return tchdev; }
set { tchdev = value; }
}
}
と私は上記のインターフェイスを実装しました。サービスを実行すると、以下のエラーが表示されます。誰か助けてくれますか?
タイプ 'System.Windows.Input.TouchDevice'はシリアル化できません。 をDataContractAttribute属性でマークし、DataMemberAttribute 属性を使用してシリアル化するメンバーのすべてを にマーキングします。
3rdpartyreturntypeのすべてのラッパーを記述できますか?もしそうなら、それらは '[DataMember]'属性でマークすることができます。 –