-
Notifications
You must be signed in to change notification settings - Fork 564
[.NET 5] Update TargetFramework to net5.0 #4692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src/Xamarin.Android.Build.Tasks/Xamarin.Android.Tooling.targets
Outdated
Show resolved
Hide resolved
The latest .NET 5 previews now have support for a $(TargetFramework) of
`net5.0`, which allows us to replace our usage of `netcoreapp5.0` with
`net5.0`.
The .NET 5 version of `_ResolveSdks` has also been updated to avoid
avoid usage of $(TargetFramework) when setting the path to
`Mono.Android.dll`. This fixes an issue that was occurring when using
the latest .NET 5 nightly preview, which was the result of Android
projects using targeting packs with different $(TargetFramework) values.
/Users/peter/.nuget/packages/microsoft.android.sdk/10.0.100-ci.net5-fix-tf.22/tools/Xamarin.Android.Tooling.targets(61,5): error XARSD7004: System.ArgumentException: `/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/5.0.0-preview.6.20264.1/ref/netcoreapp5.0` must be a directory! (Parameter 'frameworkDirectories')
/Users/peter/.nuget/packages/microsoft.android.sdk/10.0.100-ci.net5-fix-tf.22/tools/Xamarin.Android.Tooling.targets(61,5): error XARSD7004: at Xamarin.Android.Tools.AndroidVersions..ctor(IEnumerable`1 frameworkDirectories) in /Users/peter/source/pj/xamarin-android/external/xamarin-android-tools/src/Xamarin.Android.Tools.AndroidSdk/AndroidVersions.cs:line 30
/Users/peter/.nuget/packages/microsoft.android.sdk/10.0.100-ci.net5-fix-tf.22/tools/Xamarin.Android.Tooling.targets(61,5): error XARSD7004: at Xamarin.Android.Tasks.MonoAndroidHelper.RefreshSupportedVersions(String[] referenceAssemblyPaths)
/Users/peter/.nuget/packages/microsoft.android.sdk/10.0.100-ci.net5-fix-tf.22/tools/Xamarin.Android.Tooling.targets(61,5): error XARSD7004: at Xamarin.Android.Tasks.ResolveSdks.RunTask()
/Users/peter/.nuget/packages/microsoft.android.sdk/10.0.100-ci.net5-fix-tf.22/tools/Xamarin.Android.Tooling.targets(61,5): error XARSD7004: at Xamarin.Android.Tasks.AndroidTask.Execute()
da0ae13 to
a816e23
Compare
Certain tasks require that $(_XATargetFrameworkDirectories) contains paths to both Mono.Android.dll and mscorlib.dll. In order to ensure that this property contains all known assembly paths we'll use the @(ResolvedTargetingPack) ItemGroup. These items contain metadata definitions for %(TargetFramework) and %(PackagePath), which can be combined to construct the full assembly path for each pack.
jonathanpeppers
approved these changes
May 18, 2020
radekdoulik
approved these changes
May 19, 2020
dellis1972
approved these changes
May 19, 2020
jonathanpeppers
added a commit
to dotnet/maui-samples
that referenced
this pull request
Jun 2, 2020
Fixes: #16 `$(TargetFramework)` should be `net5.0` now. Android has the following fixes: * dotnet/android#4663 * dotnet/android#4692 This enables several workarounds to be removed. Also use the same .NET 5 build as xamarin-android: https://github.com/xamarin/xamarin-android/blob/cde7b79dce48d9f3fdfc396641a01fb27d165042/build-tools/automation/azure-pipelines.yaml#L53
jonathanpeppers
added a commit
to dotnet/maui-samples
that referenced
this pull request
Jun 3, 2020
Fixes: #16 `$(TargetFramework)` should be `net5.0` now. Android has the following fixes: * dotnet/android#4663 * dotnet/android#4692 This enables several workarounds to be removed. Also use the same .NET 5 build as xamarin-android: https://github.com/xamarin/xamarin-android/blob/cde7b79dce48d9f3fdfc396641a01fb27d165042/build-tools/automation/azure-pipelines.yaml#L53
jonathanpeppers
added a commit
to dotnet/maui-samples
that referenced
this pull request
Jun 3, 2020
Fixes: #16 `$(TargetFramework)` should be `net5.0` now. Android has the following fixes: * dotnet/android#4663 * dotnet/android#4692 This enables several workarounds to be removed. Also use the same .NET 5 build as `xamarin-android`: https://github.com/xamarin/xamarin-android/blob/cde7b79dce48d9f3fdfc396641a01fb27d165042/build-tools/automation/azure-pipelines.yaml#L53 I updated the `README.md` and our Azure DevOps build pipeline.
jonathanpeppers
added a commit
to dotnet/maui-samples
that referenced
this pull request
Jun 3, 2020
Fixes: #16 `$(TargetFramework)` should be `net5.0` now. Android has the following fixes: * dotnet/android#4663 * dotnet/android#4692 This enables several workarounds to be removed. Also use the same .NET 5 build as `xamarin-android`: https://github.com/xamarin/xamarin-android/blob/cde7b79dce48d9f3fdfc396641a01fb27d165042/build-tools/automation/azure-pipelines.yaml#L53 I updated the `README.md` and our Azure DevOps build pipeline.
jonathanpeppers
added a commit
to dotnet/maui-samples
that referenced
this pull request
Jun 3, 2020
Fixes: #16 `$(TargetFramework)` should be `net5.0` now. Android has the following fixes: * dotnet/android#4663 * dotnet/android#4692 This enables several workarounds to be removed. Also use the same .NET 5 build as `xamarin-android`: https://github.com/xamarin/xamarin-android/blob/cde7b79dce48d9f3fdfc396641a01fb27d165042/build-tools/automation/azure-pipelines.yaml#L53 I updated the `README.md` and our Azure DevOps build pipeline.
jonathanpeppers
added a commit
to dotnet/maui-samples
that referenced
this pull request
Jun 3, 2020
Fixes: #16 `$(TargetFramework)` should be `net5.0` now. Android has the following fixes: * dotnet/android#4663 * dotnet/android#4692 This enables several workarounds to be removed. Also use the same .NET 5 build as `xamarin-android`: https://github.com/xamarin/xamarin-android/blob/cde7b79dce48d9f3fdfc396641a01fb27d165042/build-tools/automation/azure-pipelines.yaml#L53 I updated the `README.md` and our Azure DevOps build pipeline.
jonathanpeppers
added a commit
to dotnet/maui-samples
that referenced
this pull request
Jun 3, 2020
Fixes: #16 `$(TargetFramework)` should be `net5.0` now. Android has the following fixes: * dotnet/android#4663 * dotnet/android#4692 This enables several workarounds to be removed. Also use the same .NET 5 build as `xamarin-android`: https://github.com/xamarin/xamarin-android/blob/cde7b79dce48d9f3fdfc396641a01fb27d165042/build-tools/automation/azure-pipelines.yaml#L53 I updated the `README.md` and our Azure DevOps build pipeline.
jonathanpeppers
added a commit
to dotnet/maui-samples
that referenced
this pull request
Jun 4, 2020
Fixes: #16 `$(TargetFramework)` should be `net5.0` now. Android has the following fixes: * dotnet/android#4663 * dotnet/android#4692 This enables several workarounds to be removed. Also use the same .NET 5 build as `xamarin-android`: https://github.com/xamarin/xamarin-android/blob/cde7b79dce48d9f3fdfc396641a01fb27d165042/build-tools/automation/azure-pipelines.yaml#L53 I updated the `README.md` and our Azure DevOps build pipeline.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The latest .NET 5 previews now have support for a $(TargetFramework) of
net5.0, which allows us to replace our usage ofnetcoreapp5.0withnet5.0.The .NET 5 version of
_ResolveSdkshas also been updated to avoidusage of the projects $(TargetFramework) value when setting the path
to
Mono.Android.dll. This fixes an issue that was occurring whenusing the latest .NET 5 nightly preview, which was the result of Android
projects using targeting packs with different $(TargetFramework) values.