Skip to content

[msbuild] Ship the net10.0 version of our msbuild tasks.#24546

Merged
rolfbjarne merged 1 commit intomainfrom
dev/rolf/msbuild-dotnet-host
Mar 23, 2026
Merged

[msbuild] Ship the net10.0 version of our msbuild tasks.#24546
rolfbjarne merged 1 commit intomainfrom
dev/rolf/msbuild-dotnet-host

Conversation

@rolfbjarne
Copy link
Copy Markdown
Member

  • Ship the net10.0 version of our msbuild tasks.
  • This required a bit of a reshuffling of the files in our Sdk pack, since we now
    ship both a netstandard2.0 and a net10.0 version of our msbuild tasks.
  • Use the net10.0 version of the msbuild tasks by default, but allow opt-out using
    the property '_UseDesktopTaskAssemblies'.

Loading the net10.0 version of the tasks should work in VS2026, because VS2026 supports
the "Runtime=NET" metadata on the 'UsingTask' directive (VS2022 does not, but this
doesn't matter, because we don't support VS2022 anymore in .NET 10+).

Hopefully we'll be able to remove the opt-out once we've confirmed nothing breaks,
and then we can remove the netstandard2.0 versions of our task assemblies.

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

This pull request updates the MSBuild build system to ship both netstandard2.0 and net10.0 versions of the MSBuild task assemblies, with net10.0 being the default. The changes introduce new properties _TaskAssemblyName and _TaskRuntime to support loading the appropriate version of task assemblies, with an opt-out mechanism via _UseDesktopTaskAssemblies.

Changes:

  • Added support for shipping both netstandard2.0 and net10.0 task assemblies with configurable selection
  • Updated all UsingTask declarations to include Runtime metadata and use the new _TaskAssemblyName property
  • Modified Makefile to copy net10.0 assemblies to the SDK pack structure

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
msbuild/Xamarin.Shared/Xamarin.Shared.targets Added properties to select task assembly version and runtime, updated all UsingTask declarations to use new properties and Runtime attribute
msbuild/Xamarin.iOS.Tasks.Windows/Xamarin.iOS.Windows.After.targets Updated UsingTask declarations to use new Runtime attribute and _TaskAssemblyName property
msbuild/Xamarin.iOS.Tasks.Windows/Xamarin.iOS.ObjCBinding.CSharp.After.targets Updated UsingTask declaration to use new Runtime attribute and _TaskAssemblyName property
msbuild/Xamarin.iOS.Tasks.Windows/Xamarin.iOS.Common.Before.targets Removed UsingTask declaration (moved to Common.After.targets)
msbuild/Xamarin.iOS.Tasks.Windows/Xamarin.iOS.Common.After.targets Added CollectMonotouchReferences UsingTask and updated all declarations with Runtime attribute
msbuild/Xamarin.MacDev.Tasks/Xamarin.MacDev.Tasks.csproj Enabled CopyLocalLockFileAssemblies for net10.0 and disabled ILMerge for net10.0 target
msbuild/Makefile Added NETTARGETFRAMEWORK variable and updated install rules to copy both netstandard2.0 and net10.0 assemblies
msbuild/.gitignore Added .copy-stamp-* to ignore list for build artifacts
dotnet/targets/Xamarin.Shared.Sdk.targets Updated UsingTask declarations to use Runtime attribute and _TaskAssemblyName property
dotnet/targets/Xamarin.Shared.Sdk.props Removed _XamarinTaskAssembly property definition (replaced by _TaskAssemblyName)
dotnet/targets/Microsoft.MaciOS.Sdk.Xcode.targets Updated UsingTask declarations to use Runtime attribute and _TaskAssemblyName property

Comment thread msbuild/Xamarin.Shared/Xamarin.Shared.targets Outdated
Comment thread msbuild/Xamarin.Shared/Xamarin.Shared.targets Outdated
Comment thread dotnet/targets/Xamarin.Shared.Sdk.targets
Comment thread msbuild/Makefile
Comment thread msbuild/Makefile
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne rolfbjarne force-pushed the dev/rolf/msbuild-dotnet-host branch from 39f84ad to 242e7d3 Compare January 26, 2026 08:17
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne rolfbjarne force-pushed the dev/rolf/msbuild-dotnet-host branch from 36a9a3d to 53722a2 Compare March 17, 2026 13:02
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

* Ship the net10.0 version of our msbuild tasks.
* This required a bit of a reshuffling of the files in our Sdk pack, since we now
  ship both a netstandard2.0 and a net10.0 version of our msbuild tasks.
* Use the net10.0 version of the msbuild tasks by default, but allow opt-out using
  the property '_UseDesktopTaskAssemblies'.

Using the net10.0 version of the msbuild tasks is a good thing because:

* We get to use a much newer version of .NET (which is better for performance).
* We get to use newer APIs and features.
* Task assemblies are loaded in isolation from eachother, we means we don't have
  to use ILMerge to merge dependencies into a single assembly, simplifying the build
  process: https://github.com/dotnet/msbuild/blob/main/documentation/specs/task-isolation-and-dependencies.md

Loading the net10.0 version of the tasks should work in VS2026, because VS2026 supports
the "Runtime=NET" metadata on the 'UsingTask' directive (VS2022 does not, but this
doesn't matter, because we don't support VS2022 anymore in .NET 10+).

Hopefully we'll be able to remove the opt-out once we've confirmed nothing breaks,
and then we can remove the netstandard2.0 versions of our task assemblies.
@rolfbjarne rolfbjarne force-pushed the dev/rolf/msbuild-dotnet-host branch from 53722a2 to fe8a7de Compare March 19, 2026 18:59
@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [CI Build #fe8a7de] Build passed (Build packages) ✅

Pipeline on Agent
Hash: fe8a7deec4aa024483994396bb8654eb469e4ede [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [PR Build #fe8a7de] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: fe8a7deec4aa024483994396bb8654eb469e4ede [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: fe8a7deec4aa024483994396bb8654eb469e4ede [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [CI Build #fe8a7de] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: fe8a7deec4aa024483994396bb8654eb469e4ede [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

🚀 [CI Build #fe8a7de] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 156 tests passed 🎉

Tests counts

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 11 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 12 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 11 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: fe8a7deec4aa024483994396bb8654eb469e4ede [PR build]

@rolfbjarne rolfbjarne marked this pull request as ready for review March 20, 2026 09:41
@rolfbjarne rolfbjarne requested review from emaf and mauroa as code owners March 20, 2026 09:41
@rolfbjarne rolfbjarne requested a review from Copilot March 20, 2026 09:41
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

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Comment thread msbuild/Xamarin.Shared/Xamarin.Shared.targets
Comment thread msbuild/Xamarin.MacDev.Tasks/Xamarin.MacDev.Tasks.csproj
@rolfbjarne rolfbjarne merged commit e5b2061 into main Mar 23, 2026
52 checks passed
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.

5 participants