{"id":3684,"date":"2009-04-13T14:00:00","date_gmt":"2009-04-13T14:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/webdev\/2009\/04\/13\/how-to-use-wcftestclient-as-svc-file-debugger-for-vs2008-sp1\/"},"modified":"2009-04-13T14:00:00","modified_gmt":"2009-04-13T14:00:00","slug":"how-to-use-wcftestclient-as-svc-file-debugger-for-vs2008-sp1","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/how-to-use-wcftestclient-as-svc-file-debugger-for-vs2008-sp1\/","title":{"rendered":"How to use wcftestclient as svc file debugger for VS2008 SP1"},"content":{"rendered":"<p>Wcftestclient can be used to debug a WCF service. Here are two ways to enable wcftestclient debugging in Visual Studio VS2008 SP1 web applications.<\/p>\n<p><strong>Tradition way:<\/strong><\/p>\n<p>In Web application project property page, web tab, one can specify start external program and command line argument for IIS based WCF:<\/p>\n<p>1. Check Use Local IIS Web server and create a virtual directory on the local IIS (you\u2019ve to enable WCF on .net3.0 with IIS7)<\/p>\n<p>2. Specify start external program: C:Program FilesMicrosoft Visual Studio 9.0Common7IDEWcfTestClient.exe<\/p>\n<p>3. Specify command line argument: <a href=\"http:\/\/localhost\/WcfService7\/Service1.svc\">http:\/\/localhost\/WcfService7\/Service1.svc<\/a><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/16\/2019\/02\/image_2.png\"><img decoding=\"async\" style=\"border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2009\/04\/image_thumb.png\" width=\"560\" height=\"442\" \/><\/a> <\/p>\n<p>The problem with this approach is that if the project contains several wcf service or some other web page, ctrl-F5, F5 will still start the svc file.<\/p>\n<p><strong>A hidden feature in VS2008 SP1:<\/strong><\/p>\n<p>This is a hidden feature in VS2008 SP1, one can turn a project flag to enable wcftestclient.exe when debugging or run the svc file.<\/p>\n<p><strong>For Web Application Project<\/strong><\/p>\n<p>1. Make sure the Start action is \u201ccurrent page\u201d instead of the \u201cstart external program\u201d. Servers can be either \u201cUse Visual Studio Development Server\u201d or \u201cUse Local IIS Web server\u201d.<\/p>\n<p>2. Check the project directory, there is a file with .user extension, such as wcfservice7.csproj.user. Open it.<\/p>\n<p>3. This file is a xml file, near the end, there is a setting of:<\/p>\n<p>&lt;EnableWcfTestClientForSVC&gt;False&lt;\/EnableWcfTestClientForSVC&gt;<\/p>\n<p>4. Change the value to True<\/p>\n<p>5. Restart VS and reopen the project<\/p>\n<p>6. Focus to a svc file or its code behind file.<\/p>\n<p>7. Press Ctrl-F5 or F5<\/p>\n<p>The wcftestclient.exe will be automatically started for the current svc page.<\/p>\n<p><strong>For website with wcf service<\/strong><\/p>\n<p>This is a bit harder as the website does not have a project file. Do the following:<\/p>\n<p>1. Close the Visual studio, so websites.xml file get updated<\/p>\n<p>2. go to C:Users&lt;username&gt;AppDataLocalMicrosoftWebsiteCache (This is Vista\/Win2k8, XP\/2003 is in a similar location)<\/p>\n<p>3. Open websites.xml using an editor:<\/p>\n<p>4. Find the line for the newly created website<\/p>\n<p>&lt;Website RootUrl=&quot;D:SharesProgramsTestWCFService3&quot; CacheFolder=&quot;WCFService3&quot; addnewitemlang=&quot;Visual Basic&quot; targetframework=&quot;3.5&quot; vwdport=&quot;6442&quot; _LastAccess=&quot;4\/9\/2009 3:57:04 PM&quot;\/&gt;<\/p>\n<p>5. Add a new attribute enablewcftestclientforsvc =\u201dTrue\u201d, so it looks like following: <\/p>\n<p>&lt;Website RootUrl=&quot;D:SharesProgramsTestWCFService3&quot; CacheFolder=&quot;WCFService3&quot; addnewitemlang=&quot;Visual Basic&quot; targetframework=&quot;3.5&quot; enablewcftestclientforsvc=\u201dTrue\u201d vwdport=&quot;6442&quot; _LastAccess=&quot;4\/9\/2009 3:57:04 PM&quot;\/&gt;<\/p>\n<p>6. Save the xml file<\/p>\n<p>7. Start VS, and reload the project<\/p>\n<p>8. Focus to svc file or its code behind file<\/p>\n<p>8. Press Ctrl-F5 or F5 <\/p>\n<p>The wcftestclient.exe will be automatically started for the current svc page.<\/p>\n<p>Please note, this is only a workaround to help customers to launch wcftestclient for svc files more easily. We didn\u2019t make it true by default due to the limitation of the design. Hopefully, we can provide a better solution in the future.<\/p>\n<p>Xinyang Qiu    <br \/>SDETII     <br \/>Visual Studio Web Tools<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Wcftestclient can be used to debug a WCF service. Here are two ways to enable wcftestclient debugging in Visual Studio VS2008 SP1 web applications. Tradition way: In Web application project property page, web tab, one can specify start external program and command line argument for IIS based WCF: 1. Check Use Local IIS Web server [&hellip;]<\/p>\n","protected":false},"author":404,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[197],"tags":[7316,7339],"class_list":["post-3684","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aspnet","tag-visual-studio-2008-sp1","tag-wcf"],"acf":[],"blog_post_summary":"<p>Wcftestclient can be used to debug a WCF service. Here are two ways to enable wcftestclient debugging in Visual Studio VS2008 SP1 web applications. Tradition way: In Web application project property page, web tab, one can specify start external program and command line argument for IIS based WCF: 1. Check Use Local IIS Web server [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/3684","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/404"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=3684"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/3684\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=3684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=3684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=3684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}