0
我已經創建了一個Silverlight商業應用程序,並在app.web項目中創建了一個域服務。Silverlight域名服務幫助
我已經創建了的DomainService類中的方法:
public String reHi()
{
return "HI";
}
裏面我的客戶,Silverlight的網頁我已經建立了namepsace
using System.ServiceModel.DomainServices.Client;
我遂把下面的代碼獲取上下文:
Repas.Web.RepasContext t = new Repas.Web.RepasContext();
MessageBox.Show(t.reHi());
該項目然後無法生成錯誤:
Error 2 Argument 1: cannot convert from 'System.ServiceModel.DomainServices.Client.InvokeOperation' to 'string'
我加入一個toString的代碼,看看它會輸出,但我得到:
System.ServiceModel.DomainServices.Client.InvokeOperation`1[System.String]
有人可以幫助我得到的輸出(「你好」),我需要的。
謝謝。
我將如何能夠做到這一點? – 2011-04-14 22:02:22
查看我的更新(現在有樣品代碼) – Jacob 2011-04-14 22:03:34
使用你的代碼沒有工作,沒有操作。結果,主要告訴我,由於它的保護級別而無法訪問的錯誤 – 2011-04-14 22:07:20