Repository navigation
[main] Keep using the desktop MSBuild assemblies when building from within Visual Studio. - #25417
Conversation
…ing from within Visual Studio. Keep using the desktop MSBuild assemblies when building from within Visual Studio, while we track down why it's not working and fix it for a future release. Ref: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2968169
There was a problem hiding this comment.
Pull request overview
This PR adjusts the iOS SDK MSBuild properties so that when building inside Visual Studio, the build continues to use the desktop-compatible (netstandard2.0) MSBuild task assemblies. This is a temporary compatibility measure while investigating why the newer task assembly path isn’t working correctly in Visual Studio.
Changes:
- Set
_UseDesktopTaskAssemblies=trueby default when$(BuildingInsideVisualStudio)istrue(unless already overridden). - Switch
CoreiOSSdkDirectoryto point at thenetstandard2.0task directory when_UseDesktopTaskAssembliesis enabled.
✅ [PR Build #4d83de0] Build passed (Detect API changes) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #4d83de0] Build passed (Build packages) ✅Pipeline on Agent |
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
✅ [PR Build #4d83de0] Build passed (Build macOS tests) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build #4d83de0] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 175 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
…25662) ## Description Building a MacCatalyst app inside Visual Studio on Windows ARM64 fails with: ``` error MSB4216: Could not run the "MakeDir" task because MSBuild could not create or connect to a task host with runtime "NET" and architecture "*". ``` ## Root cause Inside Visual Studio, our MSBuild tasks should run in-process using the `netstandard2.0` assemblies. This is controlled by the `_UseDesktopTaskAssemblies` property. When it is not set, the tasks instead use the `.NET` assemblies, which need a separate .NET task host. That task host does not work reliably from Visual Studio, and fails on Windows ARM64. #25417 set `_UseDesktopTaskAssemblies` for Visual Studio builds, but only in the iOS SDK. MacCatalyst, macOS and tvOS were missed, so they still try to use the .NET task host and break. ## Fix Set `_UseDesktopTaskAssemblies` in the shared `Xamarin.Shared.Sdk.props`, which is imported by all four platforms, so the workaround applies everywhere. The iOS SDK keeps setting it earlier (it also needs it for `CoreiOSSdkDirectory`); the `== ''` guard makes the shared copy a no-op for iOS. Ref: #25418 --------- Co-authored-by: Milos KotlarCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… for all platforms (#25718) ## Description Building a MacCatalyst app inside Visual Studio on Windows ARM64 fails with: ``` error MSB4216: Could not run the "MakeDir" task because MSBuild could not create or connect to a task host with runtime "NET" and architecture "*". ``` ## Root cause Inside Visual Studio, our MSBuild tasks should run in-process using the `netstandard2.0` assemblies. This is controlled by the `_UseDesktopTaskAssemblies` property. When it is not set, the tasks instead use the `.NET` assemblies, which need a separate .NET task host. That task host does not work reliably from Visual Studio, and fails on Windows ARM64. #25417 set `_UseDesktopTaskAssemblies` for Visual Studio builds, but only in the iOS SDK. MacCatalyst, macOS and tvOS were missed, so they still try to use the .NET task host and break. ## Fix Set `_UseDesktopTaskAssemblies` in the shared `Xamarin.Shared.Sdk.props`, which is imported by all four platforms, so the workaround applies everywhere. The iOS SDK keeps setting it earlier (it also needs it for `CoreiOSSdkDirectory`); the `== ''` guard makes the shared copy a no-op for iOS. Ref: #25418 --------- Co-authored-by: Milos KotlarCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Backport of #25662. Co-authored-by: Milos Kotlar Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep using the desktop MSBuild assemblies when building from within Visual
Studio, while we track down why it's not working and fix it for a future release.
Ref: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2968169
Ref: #25418
Backport of #25249.