microsoft / microsoft/winget-cli

packageManager.CreateCompositePackageCatalog(createOptions).Connect() returns CatalogError as status unless Microsoft.WindowsPackageManager.InProcCom >= 1.11.510

Open
#5,954 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-COM-API Issue-Bug
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

Relevant area(s)

COM API

Relevant command(s)

No response

Brief description of your issue

Calling: packageManager.CreateCompositePackageCatalog(createOptions).Connect();

returns CatalogError when using CompositeSearchBehavior.LocalCatalogs (or any other catalog), unless
the application references Microsoft.WindowsPackageManager.InProcCom version 1.11.510 or higher.

Noticed this behavior appearing in the last 2–3 weeks without any code changes in my projects.

Steps to reproduce

using Microsoft.Management.Deployment;

static void Main(string[] args)
{
var packageManager = new PackageManager();

var createOptions = new CreateCompositePackageCatalogOptions
{
    CompositeSearchBehavior = CompositeSearchBehavior.LocalCatalogs
};

var packageCatalogs = packageManager.GetPackageCatalogs();
foreach (var cat in packageCatalogs)
{
    createOptions.Catalogs.Add(cat);
}

var compositeConnectResult =
    packageManager.CreateCompositePackageCatalog(createOptions).Connect();

// compositeConnectResult.Status == CatalogError

var options = new FindPackagesOptions();
var result = compositeConnectResult.PackageCatalog.FindPackages(options);  // This throws null exception

}

Expected behavior

packageManager.CreateCompositePackageCatalog(createOptions).Connect() should:

Behave consistently across supported InProcCom versions and not randomly stop working in older versions.

Actual behavior

Connect() returns CatalogError in older versions

Environment
Windows 10 or Windows 11 device

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the CreateCompositePackageCatalog(createOptions).Connect() example on Windows 10 or 11 with different Microsoft.WindowsPackageManager.InProcCom versions. Compare the returned status and subsequent PackageCatalog behavior; done means Connect() behaves consistently across supported versions instead of returning CatalogError on older versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.