Vivek Nuna
Vivek Nuna

Reputation: 1

How to run WcfTestClient from Visual Studio 2022?

I have installed VS 2022, I need to use the WcfTestClient to test my service. But I cannot find it.

It used to be in the below location in VS 2019.

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE

Upvotes: 13

Views: 21021

Answers (3)

Sumit Mahajan
Sumit Mahajan

Reputation: 1

  1. Make sure WCF tooling is installed as suggested by @Jimmy
  2. Make sure IIS is enabled on your Windows machine

To enable IIS:

Go to Control Panel -> Programs

Under Programs and Features, click on Turn Windows features on or off

Select every checkbox under Internet Information Services -> Click Ok

That's all.

Upvotes: 0

Kurtbaby
Kurtbaby

Reputation: 846

FYI. Even if you install the WCF option, the WcfTestClient that currently ships with VS2022 up to version 17.1.0 is broken. The issue is easy to duplicate. Simply create a WCF Service Application using the standard template and then run the app with Service1.svc.cs open as the current document. It will launch with your service but as soon as you select a method in the left pane and then click on any cell in the right grid, it crashes with the following exception:

Managed Debugging Assistant 'PInvokeStackImbalance' : 'A call to PInvoke function 'Microsoft.VisualStudio.VirtualTreeGrid! Microsoft.VisualStudio.VirtualTreeGrid.NativeMethods::NotifyWinEvent' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.'

The issue has been reported to Microsoft, but as of right now it appears that they consider it a low priority. The workaround we use is to leave VS2019 installed and create a short-cut to the VS2019 version of the WcfTestClient, and then execute the VS2019 version manually to test our services.

Upvotes: 4

Jimmy
Jimmy

Reputation: 28416

Two things to check:

  1. Do you have the WCF tooling installed? Double check this in the VS installer by going to Modify your install and search for it in the Individual Components tab: Showing the WCF tooling installation state
  2. Make sure you're looking in the 64-bit installation path. Since VS2022 is 64-bit, it is now installed under c:\Program Files\ (without the (x86)).

Upvotes: 38

Related Questions