1
我創建了一個基本的WCF服務。它在下面顯示的行處引發異常。參數異常未處理(實體框架,WCF)
ServiceHost host = new ServiceHost(typeof(MyApplication.ITransactionService1));
類型「System.ArgumentException」未處理的異常發生在System.ServiceModel.dll 其他信息:ServiceHost的只支持類服務類型。
是什麼'ITransactionService1'樣子? – mike
我認爲你需要傳遞類似'typeof(MyApplication.ConcreteTransactionService)'看起來你正在獲取接口的類型而不是實現。 –
@mike只是這就是它的接口..公共接口ITransactionService1 { [OperationContract的] [FaultContract(typeof運算(MyException))] [TransactionFlow(TransactionFlowOption.Allowed) 無效InsertData(INT ID,字符串名稱); } public class MyException { [DataMember] public string ErrorText {get;組; } } –