gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 15:00:38 26 4
gpt4 key购买 nike

我想在不安装 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)

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

两者都是直接从 VS2012 IDE 文件夹中复制的。

最佳答案

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

关于.net - 复制到其他计算机时无法在 WcfTestClient 中添加服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15325867/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com