Skip to content

[net11.0] Bundle DynamicLibrary publish items added after _ComputePublishLocation#25582

Closed
kotlarmilos wants to merge 1 commit into
net11.0from
dev/kotlarmilos/fix-late-dynamiclibrary-publishfoldertype
Closed

[net11.0] Bundle DynamicLibrary publish items added after _ComputePublishLocation#25582
kotlarmilos wants to merge 1 commit into
net11.0from
dev/kotlarmilos/fix-late-dynamiclibrary-publishfoldertype

Conversation

@kotlarmilos
Copy link
Copy Markdown
Member

@kotlarmilos kotlarmilos commented May 29, 2026

Description

_ComputePublishLocation resolves the final RelativePath for DynamicLibrary items in ResolvedFileToPublish, but on iOS, tvOS, and MacCatalyst it runs early as a dependency of _CreateRuntimeConfiguration. Any item added later by an extension hooking the documented BeforeTargets="ComputeFilesToPublish" extension point keeps its raw RelativePath and lands in bin/.../publish/ instead of the signed .app bundle, because the second _ComputePublishLocation invocation is cached and skipped. This breaks the VS Code MAUI extension's CoreCLR remote-debugger flow.

The fix is to add _BundleLateDynamicLibrariesToPublish to CreateAppBundleDependsOn, between _ComputePublishLocation and _ComputeCodesignItems.

…lishLocation

_ComputePublishLocation resolves the final RelativePath for DynamicLibrary
and PluginLibrary items in ResolvedFileToPublish, but on iOS, tvOS, and
Mac Catalyst it runs early as a dependency of _CreateRuntimeConfiguration.
Any item added later by an extension hooking the documented
BeforeTargets="ComputeFilesToPublish" extension point keeps its raw
RelativePath and lands in bin/.../publish/ instead of the signed .app
bundle, because the second _ComputePublishLocation invocation is cached
and skipped. This breaks the VS Code MAUI extension's CoreCLR
remote-debugger flow: libvsdbgremotecoreclrtarget.dylib never reaches the
bundle, CORECLR_PROFILER_PATH cannot load the profiler on launch, and
every user breakpoint reports "failed to bind".

Add _BundleLateDynamicLibrariesToPublish to CreateAppBundleDependsOn,
between _ComputePublishLocation and _ComputeCodesignItems. It re-routes
any DynamicLibrary or PluginLibrary item whose RelativePath does not
already point inside _RelativeAppBundlePath so the rest of the iOS SDK
pipeline (codesign, layout, mlaunch deploy) treats it like any other
native dependency.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 29, 2026 13:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a bundling regression where DynamicLibrary / PluginLibrary items added by extensions via BeforeTargets="ComputeFilesToPublish" ended up in bin/.../publish/ instead of inside the .app, because _ComputePublishLocation had already run (cached) as a dependency of _CreateRuntimeConfiguration before those late items existed. This breaks the VS Code MAUI CoreCLR remote debugger flow (the profiler dylib never reaches the bundle and breakpoints fail to bind).

Changes:

  • Adds a new _BundleLateDynamicLibrariesToPublish target that re-routes late ResolvedFileToPublish items with PublishFolderType of DynamicLibrary/PluginLibrary (and CopyToAppBundle != false) into _RelativeAppBundlePath, mirroring the pattern in _ComputeDynamicLibrariesToPublish.
  • Inserts the new target into CreateAppBundleDependsOn between _ComputePublishLocation and _ComputeCodesignItems so the items are picked up by codesign/copy steps.
Show a summary per file
File Description
dotnet/targets/Xamarin.Shared.Sdk.targets Adds _BundleLateDynamicLibrariesToPublish to the app-bundle pipeline and defines the target that rewrites late dylib/plugin item paths into the bundle.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 2

Comment thread dotnet/targets/Xamarin.Shared.Sdk.targets
Comment thread dotnet/targets/Xamarin.Shared.Sdk.targets
@kotlarmilos kotlarmilos changed the title [net11.0] bundle DynamicLibrary publish items added after _ComputePublishLocation [net11.0] Bundle DynamicLibrary publish items added after _ComputePublishLocation May 29, 2026
@kotlarmilos kotlarmilos requested a review from rolfbjarne May 29, 2026 14:21
@kotlarmilos kotlarmilos self-assigned this May 29, 2026
@kotlarmilos kotlarmilos added this to the .NET 11 milestone May 29, 2026
@kotlarmilos
Copy link
Copy Markdown
Member Author

Already fixed in the extensions repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants