Skip to content

Conversation

@rolfbjarne
Copy link
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.

* 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
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

<_TaskAssemblyFileNameWindows>Xamarin.iOS.Tasks.Windows.dll</_TaskAssemblyFileNameWindows>
<_TaskAssemblyName>$(MSBuildThisFileDirectory)\$(_TaskAssemblyFileName)</_TaskAssemblyName>
<_TaskAssemblyName Condition="'$(_UseDesktopTaskAssemblies)' != 'true'">$(MSBuildThisFileDirectory)\net$(BundledNETCoreAppTargetFrameworkVersion)\$(_TaskAssemblyFileName)</_TaskAssemblyName>
<_TaskAssemblyName Condition="'$(_UseDesktopTaskAssemblies)' == 'true'">$(MSBuildThisFileDirectory)\netstandard2.0\$(_TaskAssemblyFileName)</_TaskAssemblyName>
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

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

The property _TaskAssemblyFileNameWindows should have a corresponding full-path property similar to _TaskAssemblyName. The UsingTask declarations in Windows-specific target files are using just the filename without a path, which may cause task loading issues. Consider adding _TaskAssemblyNameWindows with a full path similar to how _TaskAssemblyName is defined on lines 24-25.

Suggested change
<_TaskAssemblyName Condition="'$(_UseDesktopTaskAssemblies)' == 'true'">$(MSBuildThisFileDirectory)\netstandard2.0\$(_TaskAssemblyFileName)</_TaskAssemblyName>
<_TaskAssemblyName Condition="'$(_UseDesktopTaskAssemblies)' == 'true'">$(MSBuildThisFileDirectory)\netstandard2.0\$(_TaskAssemblyFileName)</_TaskAssemblyName>
<_TaskAssemblyNameWindows Condition="'$(_UseDesktopTaskAssemblies)' != 'true'">$(MSBuildThisFileDirectory)\net$(BundledNETCoreAppTargetFrameworkVersion)\$(_TaskAssemblyFileNameWindows)</_TaskAssemblyNameWindows>
<_TaskAssemblyNameWindows Condition="'$(_UseDesktopTaskAssemblies)' == 'true'">$(MSBuildThisFileDirectory)\netstandard2.0\$(_TaskAssemblyFileNameWindows)</_TaskAssemblyNameWindows>

Copilot uses AI. Check for mistakes.
@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
Copy link
Collaborator

💻 [CI Build #a01c8fd] Tests on macOS X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: a01c8fd01ab0cbd2e3400b12795fa8e15f3c7ecf [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #a01c8fd] Tests on macOS M1 - Mac Monterey (12) passed 💻

All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent
Hash: a01c8fd01ab0cbd2e3400b12795fa8e15f3c7ecf [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #a01c8fd] Tests on macOS M1 - Mac Ventura (13) passed 💻

All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent
Hash: a01c8fd01ab0cbd2e3400b12795fa8e15f3c7ecf [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #a01c8fd] Tests on macOS arm64 - Mac Sequoia (15) passed 💻

All tests on macOS arm64 - Mac Sequoia (15) passed.

Pipeline on Agent
Hash: a01c8fd01ab0cbd2e3400b12795fa8e15f3c7ecf [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #a01c8fd] Tests on macOS arm64 - Mac Tahoe (26) passed 💻

All tests on macOS arm64 - Mac Tahoe (26) passed.

Pipeline on Agent
Hash: a01c8fd01ab0cbd2e3400b12795fa8e15f3c7ecf [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #52e9a27] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 52e9a2780c8f26a6ab9c42121e42be79fb04f3f7 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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

Pipeline on Agent
Hash: 52e9a2780c8f26a6ab9c42121e42be79fb04f3f7 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 [CI Build #52e9a27] Build failed (Build macOS tests) 🔥

Build failed for the job 'Build macOS tests' (with job status 'Failed')

Pipeline on Agent
Hash: 52e9a2780c8f26a6ab9c42121e42be79fb04f3f7 [PR build]

@vs-mobiletools-engineering-service2
Copy link
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: 52e9a2780c8f26a6ab9c42121e42be79fb04f3f7 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 [CI Build #52e9a27] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

4 tests crashed, 91 tests failed, 6 tests passed.

Failures

❌ dotnettests tests (iOS)

1 tests failed, 0 tests passed.

Failed tests

  • DotNet tests: Failed (Execution failed with exit code 1)
    • Xamarin.Tests.AppIconTest.AlternateAppIcon_Failure(iOS,"ios-arm6...: Failure when comparing error messages:
      Unexpected error message #0:
      Expected: Can't find the AlternateAppIcon 'InexistentAppI...
    • Xamarin.Tests.AppIconTest.AlternateAppIcon_Failure(iOS,"iossimul...: Failure when comparing error messages:
      Unexpected error message #0:
      Expected: Can't find the AlternateAppIcon 'InexistentAppI...
    • Xamarin.Tests.AppIconTest.AlternateAppIcon(iOS,"ios-arm64"): 'dotnet build' failed with exit code 1
      Full command: /Users/builder/azdo/_work/1/s/macios/builds/downloads/dotnet-sdk-10.0.103-s...
    • ... and 180 more

Html Report (VSDrops) Download

❌ dotnettests tests (MacCatalyst)

1 tests failed, 0 tests passed.

Failed tests

  • DotNet tests: Failed (Execution failed with exit code 1)
    • Xamarin.Tests.AppIconTest.AlternateAppIcon_Failure(MacCatalyst,"...: Failure when comparing error messages:
      Unexpected error message #0:
      Expected: Can't find the AlternateAppIcon 'InexistentAppI...
    • Xamarin.Tests.AppIconTest.AlternateAppIcon_Failure(MacCatalyst,"...: Failure when comparing error messages:
      Unexpected error message #0:
      Expected: Can't find the AlternateAppIcon 'InexistentAppI...
    • Xamarin.Tests.AppIconTest.AlternateAppIcon(MacCatalyst,"maccatal...: 'dotnet build' failed with exit code 1
      Full command: /Users/builder/azdo/_work/1/s/macios/builds/downloads/dotnet-sdk-10.0.103-s...
    • ... and 148 more

Html Report (VSDrops) Download

❌ dotnettests tests (macOS)

1 tests failed, 0 tests passed.

Failed tests

  • DotNet tests: Failed (Execution failed with exit code 1)
    • Xamarin.Tests.AppIconTest.AlternateAppIcon_Failure(MacOSX,"osx-a...: Failure when comparing error messages:
      Unexpected error message #0:
      Expected: Can't find the AlternateAppIcon 'InexistentAppI...
    • Xamarin.Tests.AppIconTest.AlternateAppIcon_Failure(MacOSX,"osx-x...: Failure when comparing error messages:
      Unexpected error message #0:
      Expected: Can't find the AlternateAppIcon 'InexistentAppI...
    • Xamarin.Tests.AppIconTest.AlternateAppIcon(MacOSX,"osx-arm64;osx...: 'dotnet build' failed with exit code 1
      Full command: /Users/builder/azdo/_work/1/s/macios/builds/downloads/dotnet-sdk-10.0.103-s...
    • ... and 151 more

Html Report (VSDrops) Download

❌ dotnettests tests (Multiple platforms)

1 tests failed, 0 tests passed.

Failed tests

  • DotNet tests: Failed (Execution failed with exit code 1)
    • Xamarin.Tests.DotNetProjectTest.AppWithGenericLibraryReference(i...: 'dotnet build' failed with exit code 1
      Full command: /Users/builder/azdo/_work/1/s/macios/builds/downloads/dotnet-sdk-10.0.103-s...
    • Xamarin.Tests.DotNetProjectTest.AppWithGenericLibraryReference(M...: 'dotnet build' failed with exit code 1
      Full command: /Users/builder/azdo/_work/1/s/macios/builds/downloads/dotnet-sdk-10.0.103-s...
    • Xamarin.Tests.DotNetProjectTest.AppWithGenericLibraryReference(M...: 'dotnet build' failed with exit code 1
      Full command: /Users/builder/azdo/_work/1/s/macios/builds/downloads/dotnet-sdk-10.0.103-s...
    • ... and 21 more

Html Report (VSDrops) Download

❌ dotnettests tests (tvOS)

1 tests failed, 0 tests passed.

Failed tests

  • DotNet tests: Failed (Execution failed with exit code 1)
    • Xamarin.Tests.AppIconTest.AlternateAppIcon_Failure(TVOS,"tvos-ar...: Failure when comparing error messages:
      Unexpected error message #0:
      Expected: Can't find the AlternateAppIcon 'InexistentAppI...
    • Xamarin.Tests.AppIconTest.AlternateAppIcon_Failure(TVOS,"tvossim...: Failure when comparing error messages:
      Unexpected error message #0:
      Expected: Can't find the AlternateAppIcon 'InexistentAppI...
    • Xamarin.Tests.AppIconTest.AlternateAppIcon(TVOS,"tvos-arm64"): 'dotnet build' failed with exit code 1
      Full command: /Users/builder/azdo/_work/1/s/macios/builds/downloads/dotnet-sdk-10.0.103-s...
    • ... and 126 more

Html Report (VSDrops) Download

❌ framework tests

2 tests failed, 0 tests passed.

Failed tests

  • framework-test/macOS/Debug: BuildFailure
  • framework-test/Mac Catalyst/Debug: BuildFailure

Html Report (VSDrops) Download

❌ fsharp tests

4 tests failed, 0 tests passed.

Failed tests

  • fsharp/macOS/Debug: BuildFailure
  • fsharp/Mac Catalyst/Debug: BuildFailure
  • fsharp/iOS - simulator/Debug: BuildFailure
  • fsharp/tvOS - simulator/Debug: BuildFailure

Html Report (VSDrops) Download

❌ generator tests

1 tests failed, 4 tests passed.

Failed tests

  • Roslyn Transformer tests: TimedOut (Execution timed out after 30 minutes.)

Html Report (VSDrops) Download

❌ interdependent-binding-projects tests

🔥 Failed catastrophically on VSTS: test results - interdependent-binding-projects (no summary found).

Html Report (VSDrops) Download

❌ introspection tests

4 tests failed, 0 tests passed.

Failed tests

  • introspection/macOS/Debug: BuildFailure
  • introspection/Mac Catalyst/Debug: BuildFailure
  • introspection/iOS - simulator/Debug: BuildFailure
  • introspection/tvOS - simulator/Debug: BuildFailure

Html Report (VSDrops) Download

❌ linker tests

44 tests failed, 0 tests passed.

Failed tests

  • dont link/macOS/Debug: BuildFailure
  • dont link/macOS/Release: BuildFailure
  • dont link/Mac Catalyst/Debug: BuildFailure
  • dont link/Mac Catalyst/Release: BuildFailure
  • dont link/iOS - simulator/Debug: BuildFailure
  • dont link/iOS - simulator/Release: BuildFailure
  • dont link/tvOS - simulator/Debug: BuildFailure
  • dont link/tvOS - simulator/Release: BuildFailure
  • link sdk/macOS/Debug: BuildFailure
  • link sdk/macOS/Release: BuildFailure
  • link sdk/Mac Catalyst/Debug: BuildFailure
  • link sdk/Mac Catalyst/Release: BuildFailure
  • link sdk/iOS - simulator/Debug: BuildFailure
  • link sdk/iOS - simulator/Release: BuildFailure
  • link sdk/tvOS - simulator/Debug: BuildFailure
  • link sdk/tvOS - simulator/Release: BuildFailure
  • link all/macOS/Debug: BuildFailure
  • link all/macOS/Debug (don't bundle original resources): BuildFailure
  • link all/macOS/Release: BuildFailure
  • link all/Mac Catalyst/Debug: BuildFailure
  • link all/Mac Catalyst/Debug (don't bundle original resources): BuildFailure
  • link all/Mac Catalyst/Release: BuildFailure
  • link all/iOS - simulator/Debug: BuildFailure
  • link all/iOS - simulator/Release: BuildFailure
  • link all/iOS - simulator/Debug (don't bundle original resources): BuildFailure
  • link all/tvOS - simulator/Debug: BuildFailure
  • link all/tvOS - simulator/Release: BuildFailure
  • link all/tvOS - simulator/Debug (don't bundle original resources): BuildFailure
  • trimmode copy/macOS/Debug: BuildFailure
  • trimmode copy/macOS/Release: BuildFailure
  • trimmode copy/Mac Catalyst/Debug: BuildFailure
  • trimmode copy/Mac Catalyst/Release: BuildFailure
  • trimmode copy/iOS - simulator/Debug: BuildFailure
  • trimmode copy/iOS - simulator/Release: BuildFailure
  • trimmode copy/tvOS - simulator/Debug: BuildFailure
  • trimmode copy/tvOS - simulator/Release: BuildFailure
  • trimmode link/macOS/Debug: BuildFailure
  • trimmode link/macOS/Release: BuildFailure
  • trimmode link/Mac Catalyst/Debug: BuildFailure
  • trimmode link/Mac Catalyst/Release: BuildFailure
  • trimmode link/iOS - simulator/Debug: BuildFailure
  • trimmode link/iOS - simulator/Release: BuildFailure
  • trimmode link/tvOS - simulator/Debug: BuildFailure
  • trimmode link/tvOS - simulator/Release: BuildFailure

Html Report (VSDrops) Download

❌ monotouch tests (iOS)

9 tests failed, 0 tests passed.

Failed tests

  • monotouch-test/iOS - simulator/Debug: BuildFailure
  • monotouch-test/iOS - simulator/Debug (LinkSdk): BuildFailure
  • monotouch-test/iOS - simulator/Debug (static registrar): BuildFailure
  • monotouch-test/iOS - simulator/Release (all optimizations): BuildFailure
  • monotouch-test/iOS - simulator/Debug (managed static registrar): BuildFailure
  • monotouch-test/iOS - simulator/Release (managed static registrar, all optimizations): BuildFailure
  • monotouch-test/iOS - simulator/Release (NativeAOT, x64): BuildFailure
  • monotouch-test/iOS - simulator/Debug (interpreter): BuildFailure
  • monotouch-test/iOS - simulator/Release (interpreter): BuildFailure

Html Report (VSDrops) Download

❌ monotouch tests (MacCatalyst)

11 tests failed, 0 tests passed.

Failed tests

  • monotouch-test/Mac Catalyst/Debug: BuildFailure
  • monotouch-test/Mac Catalyst/Debug (managed static registrar): BuildFailure
  • monotouch-test/Mac Catalyst/Debug (static registrar): BuildFailure
  • monotouch-test/Mac Catalyst/Release (managed static registrar): BuildFailure
  • monotouch-test/Mac Catalyst/Release (managed static registrar, all optimizations): BuildFailure
  • monotouch-test/Mac Catalyst/Release (NativeAOT): BuildFailure
  • monotouch-test/Mac Catalyst/Release (NativeAOT, x64): BuildFailure
  • monotouch-test/Mac Catalyst/Release (static registrar): BuildFailure
  • monotouch-test/Mac Catalyst/Release (static registrar, all optimizations): BuildFailure
  • monotouch-test/Mac Catalyst/Debug (interpreter): BuildFailure
  • monotouch-test/Mac Catalyst/Release (interpreter): BuildFailure

Html Report (VSDrops) Download

❌ monotouch tests (macOS)

9 tests failed, 0 tests passed.

Failed tests

  • monotouch-test/macOS/Debug: BuildFailure
  • monotouch-test/macOS/Debug (managed static registrar): BuildFailure
  • monotouch-test/macOS/Debug (static registrar): BuildFailure
  • monotouch-test/macOS/Release (managed static registrar): BuildFailure
  • monotouch-test/macOS/Release (managed static registrar, all optimizations): BuildFailure
  • monotouch-test/macOS/Release (NativeAOT): BuildFailure
  • monotouch-test/macOS/Release (NativeAOT, x64): BuildFailure
  • monotouch-test/macOS/Release (static registrar): BuildFailure
  • monotouch-test/macOS/Release (static registrar, all optimizations): BuildFailure

Html Report (VSDrops) Download

❌ monotouch tests (tvOS)

🔥 Failed catastrophically on VSTS: test results - monotouch_tvos (no summary found).

Html Report (VSDrops) Download

❌ msbuild tests

1 tests failed, 1 tests passed.

Failed tests

  • MSBuild integration tests: Failed (Execution failed with exit code 1)
    • Xamarin.MacDev.Tasks.CollectAppManifestsTests.PartialAppManifest: Exit code
      Expected: 0
      But was: 1

    • Xamarin.MacDev.Tasks.DetectSigningIdentityTests.BundleIdentifier...: Exit code
      Expected: 0
      But was: 1

Html Report (VSDrops) Download

❌ windows tests

1 tests failed, 0 tests passed.
Details # 🎉 All 3 tests passed 🎉

Html Report (VSDrops) Download

❌ xcframework tests

🔥 Failed catastrophically on VSTS: test results - xcframework (no summary found).

Html Report (VSDrops) Download

❌ xtro tests

🔥 Failed catastrophically on VSTS: test results - xtro (no summary found).

Html Report (VSDrops) Download

Successes

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: 52e9a2780c8f26a6ab9c42121e42be79fb04f3f7 [PR build]

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.

3 participants