Visual Studio 2026 does not load my AsyncPackage marked with ProvideAutoLoad

5 hours ago 1
ARTICLE AD BOX

I am developing a VS 2022+ extension which needs to perform some initialization when a solution is loaded. So I marked my AsyncPackage with a ProvideAutoLoad attribute and wrote initialization code in the InitializeAsync method. Everything works as expected in VS 2022, but when I moved to VS 2026, I found that the package assembly does not load at all. How can I fix the issue?

The code:

[ProvideOptionPage(typeof(GeneralPage), GeneralPage.CategoryName, GeneralPage.PageName, 0, 0, true)] [ProvideOptionPage(typeof(GameRegistryPage), GameRegistryPage.CategoryName, GameRegistryPage.PageName, 0, 0, true)] [ProvideAutoLoad(UIContextGuids.SolutionExists, PackageAutoLoadFlags.BackgroundLoad)] [PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)] [Guid(PackageGuidString)] public sealed class UnityModStudioPackage : AsyncPackage { public const string PackageGuidString = "99ccfd83-7fd4-49c3-8021-e8ae9f4e7767"; protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress) { await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); var componentModel = (IComponentModel)(await GetServiceAsync(typeof(SComponentModel)))!; var gameRegistry = componentModel.GetService<IGameRegistry>(); await gameRegistry.LoadSafeAsync(); } }
Read Entire Article