WCF可在C#环境中工作,但不能在VB中工作... [英] WCF works in C# environment but not in VB...

查看:81
本文介绍了WCF可在C#环境中工作,但不能在VB中工作...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家早上好,
我有一个非常奇怪的问题,无法解决也无法理解.
我有一个WCF服务(C#),包装在一个类中以方便使用,该类已经过测试并且运行良好.
该包装器在C#测试环境中运行,并按预期执行.
测试表单实例化包装器,并包含一个按钮,该按钮调出TestClient,该TestClient将消息发送到服务.
到目前为止没有什么特别的.一切正常,服务接收消息并将其打印到控制台.

然后,我用VB.NET重新创建了测试表单(我们的主要环境是VB,所以这是必要的).它与C#测试表单的设置完全相同(只是包装器的一个实例和一个用于弹出TestClient-Form的按钮).但是,无论该超时定义了多长时间,通过按钮打开的客户端表单始终会因接收超时而失败.

当我自己启动testclient时(没有通过单击按钮打开测试表单),一切正常.另外,如果我将service-wrapper放入后台线程或通过process.start将其打开,一切正常.

如果仅通过单击按钮打开测试客户端,仅VB中的VB测试表单(C#始终有效)将失败.

我还使用了WcfTestClient.exe工具,并且该服务始终存在,无论测试环境的语言如何.

我也在WCF论坛中也提出了这个问题,但不幸的是,我们找不到此行为的原因( ^ ])

现在,我真的希望有人在那里对发生的事情有所了解.我可以通过使用后台线程方法来解决此问题,但是我真的很想了解真正的问题以解决它.

任何提示,想法或评论都将受到赞赏.

最好的问候
Andy

Good morning all,
I have a really strange problem that I can not fix nor understand.
I have a WCF service (C#), wrapped in a class for more convenient use that was tested and worked fine.
This wrapper runs in a C# test environment and performs as expected.
The test-form instantiates the wrapper and contains a button that brings up a TestClient which sends a message to the service.
Nothing special so far. Everything works fine, the service receives the message and prints it to the console.

I then recreated the test-form with VB.NET (our main environment is VB so this was necessary). It is exactly the same setup as the C# test-form (just an instance of the wrapper and a button to bring up the TestClient-Form). But the client-form opened by the button always fails with a receive-timeout, regardless how long this timeout is defined.

When I launch the testclient on its own (without having the test-form open it by clicking the button) everything works fine. Also if I put the service-wrapper into a background-thread or open it via process.start everything works fine.

It is just the VB test-form in VB only (C# always works) that fails if it openes the test-client via the button click.

I also used the WcfTestClient.exe tool and the service is always there, regardless of the testenvironments language.

I asked this in the WCF forum too, but unfortunately we couldn''t find the cause for this behavior (http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/876c41e7-9502-4e90-ac81-640e10b235bc/[^])

Now I really hope somebody is out there having an idea about whats going on here. I could workaround this by using the background thread approach, but I am really interested in understanding the real problem to get it solved.

Any hints, ideas or comments are kindly appreciated.

best regards
Andy

推荐答案

检查两种情况下服务配置文件是否都不同.
Check if the service configuration file is different in both the cases.


这篇关于WCF可在C#环境中工作,但不能在VB中工作...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆