In this article, I would like to share some tips of WCF Tools in VS2008 SP1. Hope this can help your better use these tools.
WCF Test Client: How to change the folder that stores temporary client configuration files and assembly files
Prior to VS2008 SP1, WCF Test Client put the temporary client configuration files and assembly files in “My Document” folder. When this folder is set as a network share, sometimes WCF Test Client cannot invoke services with the error message: “An error occurred creating the configuration section handler for system.serviceModel/bindings: That assembly does not allow partially trusted callers…”
In VS2008 SP1, we improve the experience:
First, we change the default folder from “My Document” to %temp%, because %temp% folder has less probability to be set as a network share.
Second, we also offer command line options to let the folder configurable. You can change it to your specific folder and can also restore to the default one. Snapshot below shows the detailed format of these commands.
WCF Test Client fails to add services with mismatched svcutil version
Sometimes, when svcutil.exe isn’t properly installed or installed with an earlier version in Windows SDK v6.1, WCF Test Client won’t work with the error message: “Error: Unrecognized option ‘targetclientversion’ specified.”
Please double check the below version info:
- The SvcUtil.exe shipped with Windows SDK v6.0A (which comes with VS 2008) is of version 3.0.4506.648 or above
- The SvcUtil.exe shipped with Windows SDK v6.1 is also of version 3.0.4506.648 or above
- The WcfTestClient.exe shipped with VS 2008 is of version 9.0.588.0
If the version number is wrong or svcutil.exe isn’t properly installed, the resolution is:
- Install the latest version of Windows SDK
- Or copy svcutil.exe from Windows SDK v6.0A to Windows SDK v6.1
Installing Biztalk Services SDK will introduce an unrecognized endpoint to WCF Test Client
If you have installed the Biztalk Services SDK on top of VS 2008 SP1, the Biztalk Service SDK introduces an endpoint with relayBinding in the <client> section of the <system.serviceModel> element in the machine.config file.
When adding a service to WCF Test Client, an unrecognized endpoint will be generated whose contract is IMetadataExchange. Then Test Client will report error: “The contract ‘IMetadataExchange’ in client configuration does not match the name in service contract…”. The screenshot is attached below:
After you click “OK”, the service node will appear in the tree with the redundant “IMetadataExange (sb)” section. There is no impact for the functionalities.
The screenshot is attached below:
If you will frequently add services to WCF Test Client, there is a work around to avoid the inconvenient error message:
When you run the WcfTestClient, modify the machine.config file (located in \WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG) by commenting out the <client> section below that is nested in the <system.serviceModel> element. Re-enable the section when you use the Biztalk Services SDK.
<endpoint address="" binding="relayBinding" bindingConfiguration="metadataExchangeRelayBinding"
contract="IMetadataExchange" name="sb" />
<binding name="metadataExchangeRelayBinding" />
Service Configuration Editor cannot be launched in VS after some improper installation steps
A customer reported a issue, and I would like to share with you here.
The user has VS2008 SP1 Beta, .net3.5 SP1 Beta and Windows SDK v6.1 installed in his machine, and then he installed VS2008 SP1 release and .net3.5 SP1 release. There should be some improper steps.
When he created a new WCF Service Library project and tried to launch Service Configuration Editor (SvcConfigEdior.exe) to edit the app.config file, an error dialog pop up:
There are two issues:
- SvcConfigEditor.exe in v6.0A seems disappear
- Windows SDK v6.0A is still the default SDK after installing Windows SDK v6.1. So VS tried to find SvcConfigEditor.exe in Window SDK v6.0A
To resolve the problem, I will recommend using the “Windows SDK Configuration Tool” to set the default SDK.
To avoid this problem, please make sure to uninstall the Beta versions first: not only the related programs but also the updates, before installing the Release versions.