Recently I had a WCF service that upon debugging was opening a web page with the .svc details being shown. This was not what I wanted, and my other VS.NET WCF service started just fine using the WcfClientTest tool. I checked all of the project properties and couldn’t find any setting that triggered this tool to be started.
Upon doing some digging, these configuration attributes are in the .vbproj or .vbproj.user files (.csproj or .csproj.user for C# projects). In the .vbproj file the <EnableWcfTestClientForSVCDefaultValue> tag needs to be present and set to 'true'. This can also be done in the vbproj.user file, but it is the <EnableWcfTestClientForSVC> configuration and it would also need to be set to 'true'. Only the configuration in the main .vbproj file is needed for the WCF service to start using the WcfClientTest.exe tool. Sure enough an older service of mine was completely missing this configuration. The proper configuration element is displayed below.
You can open either the .vbproj or vbproj.user files by right-clicking in Windows Explorer and opening with notepad. Once the configuration is added and set to 'true' the service will launch using the WcfClientTest.exe tool as expected.
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{123c5851-25df-10da-9384-00011b846f00}">
<WebProjectProperties>
<EnableWcfTestClientForSVCDefaultValue>True</EnableWcfTestClientForSVCDefaultValue>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
0 comments:
Post a Comment