The exception while WCF unit test executes

Aug 12, 2011 at 9:18 AM


I use WCF Load Test with VS2010.

1) When the language in VS2010 is set to Russian, after WCF Load Test installation, its template isn't visible. When I switch to English the template is visible. It seems you need to allow WCF Load Test template to be visible after installation in other languages as well.

2) My problem is as follows: 

I have solution with 3 projects: WCF service, client WPF application and WCF unit test. My WCF service is very simple. The client WPF application is simple as well. All works fine in this part. When I added WCF unit test, the wizard came up, I've filled out wizard pages and the code has been created. All was good. I've followed the instructions from this article:

According to that article I've changed InitializeTest method. What I did? In app.config file of WPF client application there's end point, which name is - BasicHttpBinding_IService1. I've put that name in this line of code in InitializeTest method:

System.ServiceModel.ChannelFactory<WcfService1.IService1> service1Factory = new System.ServiceModel.ChannelFactory<WcfService1.IService1>("BasicHttpBinding_IService1");

Also, I've copied app.config file from WPF client application to test project directory where WCF unit test is placed.

After that I've run the test and it's failed with message that says System.InvalidOperationException was thrown because the element with end point named "BasicHttpBinding_IService1" was not found.

I'm not sure how to overcome this situation.

Could you help me, please?

Thank you in advance.



Aug 22, 2011 at 8:59 AM

Apologies for the delay in answering.

Regarding the first problem I will add it to the bug list but cannot promise anything.

For the second problem, this is most likely to be simply a question of which app.config file is being read. I am not sure I am clear what you did when you say you copied the app.config to the test project directory, don't forget each test run creates a new directory. The way I do this is to include the app.config file directly in the Visual Studio test project, that way it will get deployed correctly each time by Visual Studio.

I hope this helps.