私は本当に奇妙な問題に遭遇しました。私は、非常に分散アプリケーションを構築しています。各アプリケーションインスタンスは、WCFサービスに対するホストおよび/またはクライアント(非常にp2pのようなもの)のいずれかになります。クライアントとターゲットホスト(ホストではなくアプリケーションを意味します。現在、すべてが1台のコンピュータ上で実行されるため(ファイアウォールの問題などはありません))は同じではないため、すべて正常に動作します。 それらが同じ場合、アプリは正確に1分間ハングしてからTimeoutExceptionをスローします。 WCFロギングは役に立たなかった。ここ は、問題を示し小さなアプリです:WCFホストとクライアントが同じプロセスにある場合のTimeoutException
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
var binding = new NetTcpBinding();
var baseAddress = new Uri(@"net.tcp://localhost:4000/Test");
ServiceHost host = new ServiceHost(typeof(TestService), baseAddress);
host.AddServiceEndpoint(typeof(ITestService), binding, baseAddress);
var debug = host.Description.Behaviors.Find<ServiceDebugBehavior>();
if (debug == null)
host.Description.Behaviors.Add(new ServiceDebugBehavior { IncludeExceptionDetailInFaults = true });
else
debug.IncludeExceptionDetailInFaults = true;
host.Open();
var clientBinding = new NetTcpBinding();
var testProxy = new TestProxy(clientBinding, new EndpointAddress(baseAddress));
testProxy.Test();
}
}
[ServiceContract]
public interface ITestService
{
[OperationContract]
void Test();
}
public class TestService : ITestService
{
public void Test()
{
MessageBox.Show("foo");
}
}
public class TestProxy : ClientBase<ITestService>, ITestService
{
public TestProxy(NetTcpBinding binding, EndpointAddress remoteAddress) :
base(binding, remoteAddress) { }
public void Test()
{
Channel.Test();
}
}
私が間違って何をしているのですか?
よろしく、 Pharao2k
設定はありますか? –