{"record":{"id":"6102882e09cff2a0","repo":"dotnet/wpf","slug":"printconfig-provider-mergevalidatefail","errorCode":"PrintConfig.Provider.MergeValidateFail","errorMessage":"PrintConfig.Provider.MergeValidateFail","messagePattern":"PrintConfig\\.Provider\\.MergeValidateFail","errorType":"error_code","errorClass":"PrintQueueException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/ReachFramework/PrintConfig/PTProvider.cs","lineNumber":322,"sourceCode":"\n                        if (PTUtility.IsSuccessCode(hResult))\n                        {\n                            // convert the success hResult to an enum value\n                            switch (hResult)\n                            {\n                                case (uint)NativeErrorCode.S_PT_CONFLICT_RESOLVED:\n                                {\n                                    conflictStatus = ConflictStatus.ConflictResolved;\n                                    break;\n                                }\n                                case (uint)NativeErrorCode.S_PT_NO_CONFLICT:\n                                {\n                                    conflictStatus = ConflictStatus.NoConflict;\n                                    break;\n                                }\n                                default:\n                                {\n                                    throw new PrintQueueException((int)hResult,\n                                                                  \"PrintConfig.Provider.MergeValidateFail\",\n                                                                  _deviceName);\n                                }\n                            }\n\n                            RewindIStream(validatedPrintTicketStream);\n                            \n                            return MemoryStreamFromIStream(validatedPrintTicketStream);\n                        }\n\n                        if ((hResult == (uint)NativeErrorCode.E_PRINTTICKET_FORMAT) ||\n                             (hResult == (uint)NativeErrorCode.E_DELTA_PRINTTICKET_FORMAT))\n                        {\n                            throw new ArgumentException(String.Format(CultureInfo.CurrentCulture,\n                                          \"{0} {1} {2}\",\n                                          PrintSchemaTags.Framework.PrintTicketRoot,\n                                          PTUtility.GetTextFromResource(\"FormatException.XMLNotWellFormed\"),\n                                          errorMsg),","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/ReachFramework/PrintConfig/PTProvider.cs#L304-L340","documentation":"PTProvider.MergeAndValidatePrintTicket got an unrecognized or failing HRESULT from the native PTMergeAndValidatePrintTicket call in its switch's default branch and throws PrintQueueException with reason PrintConfig.Provider.MergeValidateFail. This means the merge/validate operation failed for a reason other than conflict or ticket-format errors.","triggerScenarios":"Calling PTProvider.MergeAndValidatePrintTicket(baseTicket, deltaTicket) where the native call returns an HRESULT other than success, S_CONFLICT, or E_PRINTTICKET_FORMAT values — e.g. spooler failure or driver provider error.","commonSituations":"Driver plugin crash during merge; spooler stopped mid-operation; base and delta tickets from different devices; device disconnected from the server during the call.","solutions":["Read the HRESULT in the PrintQueueException to identify the native failure.","Verify both tickets target the same printer/driver.","Retry with only the base ticket (null delta) to isolate which ticket triggers the failure.","Restart the Print Spooler service and retry.","Update or reinstall the printer driver."],"exampleFix":"// before\nvar result = provider.MergeAndValidatePrintTicket(baseTicket, deltaTicket);\n// after\ntry { var result = provider.MergeAndValidatePrintTicket(baseTicket, deltaTicket); }\ncatch (PrintQueueException ex) {\n    var result = provider.MergeAndValidatePrintTicket(baseTicket, null); // isolate\n}","handlingStrategy":"try-catch","validationCode":"// both tickets must come from the same queue\nbool sameDevice = baseTicketSourceQueue == deltaTicketSourceQueue;","typeGuard":null,"tryCatchPattern":"try { result = provider.MergeAndValidatePrintTicket(baseTicket, deltaTicket); }\ncatch (PrintQueueException ex) when (ex.Message.Contains(\"PrintConfig.Provider.MergeValidateFail\"))\n{\n    // retry with null delta, then restart spooler / update driver\n}","preventionTips":["Ensure base and delta tickets originate from the same printer/driver.","Keep the spooler healthy and restart it after driver installs.","Isolate failures by merging with a null delta ticket."],"tags":["wpf","printing","native-interop","merge"],"backgroundTag":"api-error-response","analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-21T21:30:21.729Z"}