复制到其他计算机时,无法在WcfTestClient中添加服务

Blu*_*Fox 16 .net wcf exception-handling wcftestclient visual-studio-2012

我想在不安装VS2012的情况下在另一台机器上运行WcfTestClient(VS2012附带的一个).这可能吗?在机器上我安装了.NET 4.5,但是当我尝试添加Web服务时,它给了我以下堆栈跟踪:

************** 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)
Run Code Online (Sandbox Code Playgroud)

在WcfTestClient文件夹中我只有2个文件,是否还需要包含其他任何文件?WcfTestClient.exe WcfTestClient.exe.config

两者都直接从VS2012 IDE文件夹中复制.

Gro*_*Src 6

WCFTestClient必须在安装了SDK的计算机上运行.它不仅在注册表中查找SDK的位置,而且还运行SDK中的svcutil以生成在运行时连接的代理类.

  • 在使用VS2012 Pro(Update 4)在Windows 7上开发.Net 4.0 WCF服务时,我发现需要安装[Windows 8.0 SDK](http://msdn.microsoft.com/en-us/windows/desktop/hh852363 .aspx),而不是[Windows 7 SDK](http://www.microsoft.com/en-ca/download/details.aspx?id=8279),否则可能会假设. (3认同)