private void ImportBindings() { // not supported, only import bindings at application level // -GroupLevel Optional. If specified, ports in the binding file are imported into their associated applications. If not specified, all ports are imported // into the specified application or default application if an application name is not specified. if (this.BindingFile == null) { // -Source Required. The path and file name of the XML binding file to read. this.Log.LogError("BindingFile is required"); return; } if (!File.Exists(this.BindingFile.ItemSpec)) { // -Source Required. The path and file name of the XML binding file to read. this.Log.LogError("File {0} not found", this.BindingFile.ItemSpec); return; } if (string.IsNullOrEmpty(this.Application)) { // -ApplicationName Optional. The name of the BizTalk application. this.Application = this.explorer.DefaultApplication.Name; this.LogTaskMessage(string.Format(CultureInfo.InvariantCulture, "Using default application {0}", this.Application)); } using (DeployerComponent dc = new DeployerComponent()) { string resultMessage = string.Empty; switch (dc.ImportBindingWithValidation(this.explorer.ConnectionString, this.BindingFile.ItemSpec, this.Application, false, ref resultMessage)) { case ImportBindingError.Succeeded: // resultMessage is unchanged (string.Empty), use custom message this.LogTaskMessage(string.Format(CultureInfo.InvariantCulture, "Imported {0} into application {1}", this.BindingFile.ItemSpec, this.Application)); break; case ImportBindingError.SucceededWithWarning: // log message returned by ImportBindingWithValidation() this.Log.LogWarning(resultMessage); break; case ImportBindingError.Failed: // this is only returned if the app is not found, which will never happen since we use the default app // if there are any problems with ImportBindingWithValidation, an error will be logged anyway this.Log.LogError(resultMessage); break; } } }