private void GenerateClientClass(string endpointDirectory, string address, string configPath, string clientPath) { using (var process = new Process()) { var defaultConfigPath = Path.Combine(endpointDirectory, "default.config"); var processStartInfo = new ProcessStartInfo(_pathHelper.GetSvcutilPath()) { Arguments = $"/targetClientVersion:Version35 /r:\"{typeof(DataSet).Assembly.Location}\" \"{address}\" \"/out:{clientPath}\" \"/config:{defaultConfigPath}\"", RedirectStandardError = true, RedirectStandardOutput = true, UseShellExecute = false, CreateNoWindow = true }; process.StartInfo = processStartInfo; process.Start(); var output = process.StandardOutput.ReadToEnd(); var error = process.StandardError.ReadToEnd(); process.WaitForExit(); if (!File.Exists(clientPath) || !File.Exists(defaultConfigPath)) { throw new Exception($"svcutil.exe failed to generate client. Output: {output}, Error: {error}"); } File.Copy(defaultConfigPath, configPath, true); } }