private void ExportBindings() { // not supported, only export bindings at application level // -GroupLevel Optional. If specified, all bindings in the current group are exported. // -GlobalParties Optional. If specified, the global party information for the group is exported. // -AssemblyName Optional. The full name of the BizTalk assembly. if (this.BindingFile == null) { // -Destination Required. Path and file name of the XML binding file to write. this.Log.LogError("BindingFile is required"); return; } // use default app if no app name is provided 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)); } // create dir if it doesn't exist string dir = Path.GetDirectoryName(Path.GetFullPath(this.BindingFile.ItemSpec)); if (!Directory.Exists(dir)) { Directory.CreateDirectory(dir); this.LogTaskMessage(string.Format(CultureInfo.InvariantCulture, "Created directory {0}", dir)); } using (SqlConnection sqlConnection = new SqlConnection(this.explorer.ConnectionString)) { using (BindingInfo info = new BindingInfo()) { BindingParameters bindingParameters = new BindingParameters(new Version(info.Version)) { BindingItems = BindingParameters.BindingItemTypes.All, BindingScope = BindingParameters.BindingScopeType.Application }; info.AddApplicationRef(sqlConnection, this.Application); info.Select(sqlConnection, bindingParameters); info.SaveXml(this.BindingFile.ItemSpec); this.LogTaskMessage(string.Format(CultureInfo.InvariantCulture, "Exported {0} bindings to {1}", this.Application, this.BindingFile.ItemSpec)); } } }