Unable to add service in WcfTestClient when copy to a different machine
Asked Answered
G

3

16

I'd like to run WcfTestClient (one that's included with VS2012) on a different machine without installing VS2012. Is this possible? On the machine I've installed .NET 4.5 but when I try to add web services it gives me the following stack trace:

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Tools.Common.SdkPathUtility.GetRegistryValue(String registryPath, String registryValueName)
   at Microsoft.Tools.Common.SdkPathUtility.GetSdkPath(Version targetFrameworkVersion)
   at Microsoft.Tools.TestClient.ToolingEnvironment.get_MetadataTool()
   at Microsoft.Tools.TestClient.ServiceAnalyzer.GenerateProxyAndConfig(String projectPath, String address, String configPath, String proxyPath, Int32 startProgressPosition, Int32 endProgressPostition, BackgroundWorker addServiceWorker, String& errorMessage)
   at Microsoft.Tools.TestClient.ServiceAnalyzer.AnalyzeService(String address, BackgroundWorker addServiceWorker, Single startProgress, Single progressRange, String& errorMessage)
   at Microsoft.Tools.TestClient.Workspace.AddServiceProject(String endpoint, BackgroundWorker addServiceWorker, Single startProgress, Single progressRange, String& error)
   at Microsoft.Tools.TestClient.AddServiceExecutor.Execute(AddServiceInputs inputs, Workspace workspace, BackgroundWorker addServiceWorker)
   at Microsoft.Tools.TestClient.UI.MainForm.addServiceWorker_DoWork(Object sender, DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)

In the WcfTestClient folder I only have 2 files, is there any other files I need to include? WcfTestClient.exe WcfTestClient.exe.config

Both are copied directly from the VS2012 IDE folder.

Garling answered 10/3, 2013 at 18:26 Comment(3)
Same for me and no clue.Stefaniestefano
Have you tried to use Process Explorer to see what dlls the test client is loading? That might give you a clue as to what you might be missing.Carrasco
Heh, actually looking at the stack trace, it is trying to read SDK specific registry entries. There is no WCF SDK I think and it comes with VS so you might be out of luck.Carrasco
G
6

The WCFTestClient must be run on a computer with the SDK installed. Not only does it look in the registry to find the location of the SDK, but it also runs the svcutil from the SDK to generate the proxy classes to connect at runtime.

Grudge answered 2/12, 2013 at 20:18 Comment(3)
While developing a .Net 4.0 WCF Service on Windows 7 using VS2012 Pro (Update 4) I found I needed to install the Windows 8.0 SDK, not the Windows 7 SDK as one might otherwise assume.Tare
@MattDonald you must put it to separate answer, so i can vote for it.Belaud
@Belaud Separate answer created!Tare
T
2

While developing a .Net 4.0 WCF Service on Windows 7 using VS2012 Pro (Update 4) I found I needed to install the Windows 8.0 SDK, not the Windows 7 SDK as one might otherwise assume. (Added this answer to replace my previous comment).

Tare answered 8/9, 2015 at 16:37 Comment(0)
D
1

A bit late response, but installing the SDK on the target computer is not needed.

You just need to copy some files and ensure the existence of one registry key.

From local installed VS 2015 (v14.0):

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\WcfTestClient.exe
C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.VisualStudio.VirtualTreeGrid\v4.0_14.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.VirtualTreeGrid.dll

From local installed Windows SDK (v10):

C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\SvcUtil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\SvcConfigEditor*.*

Registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\NETFXSDK\4.6\WinSDK-NetFx40Tools-x86  (just ensure all keys exists, no content needed)

Full explanation here: https://social.msdn.microsoft.com/Forums/vstudio/en-US/c3c7221c-c06f-4364-887a-fb20f22877be/wcf-test-client-problem?prof=required (the last response, author: Jakub Bereżański)

Donyadoodad answered 5/6, 2019 at 13:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.