Windows Azure 用の appFabric のサービスを起動しようとしています。私は EchoService を実装しています。ちなみに、IEchoContract インターフェイスを実装する必要があります。これらはすべてサーバー側で行います。だから私はこのように進みます。
IEchoContract.cs について
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
namespace Service
{
[ServiceContract(Name = "EchoContract", Namespace = "http://samples.microsoft.com/ServiceModel/Relay/")]
interface IEchoContract
{
public interface IEchoContract
{
[OperationContract]
string Echo(string text);
}
}}
そして EchoSEvice.cs で
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
namespace Service
{
class EchoService
{
[ServiceBehavior(Name = "EchoService", Namespace = "http://samples.microsoft.com/ServiceModel/Relay/")]
public class EchoService : IEchoContract
{
public string Echo(string text)
{
Console.WriteLine("Echoing: {0}", text);
return text;
}
}}}
2 つのエラーが発生しました。私は C# の専門家ではありません。最初の 1 つ: EchoService を配置したとき: IEchoContract を取得しました
'EchoService': member names cannot be the same as their enclosing type
パブリック インターフェイス IEchoContract を配置したときの 2 番目
'IEchoContract' : interfaces declare types
だから助けてください。どうも。