Skip to content

[One .NET] Target net6.0 instead of netcoreapp3.1 #5891

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 10 commits into from
Apr 30, 2021
Merged

Conversation

pjcollins
Copy link
Member

Projects which were multitargeted to support .NET 6 have been updated
to target net6.0 instead of netcoreapp3.1. CI has been updated to
install .NET 6 preview 3 instead of .NET 5.

@pjcollins pjcollins marked this pull request as ready for review April 29, 2021 21:16
@pjcollins pjcollins added the do-not-merge PR should not be merged. label Apr 29, 2021
@pjcollins
Copy link
Member Author

This depends on dotnet/android-tools#118

jonathanpeppers pushed a commit to dotnet/android-tools that referenced this pull request Apr 29, 2021
Context: dotnet/android#5891

I've been hitting errors running tests locally on Windows after building
with .NET 6 Preview 3:

    Error Message:
     System.IO.FileNotFoundException : Could not load file or assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
    Stack Trace:
       at Xamarin.ProjectTools.DotNetXamarinProject.SaveProject()
     at Xamarin.ProjectTools.XamarinProject.Save(Boolean saveProject) in C:\Users\Peter\source\xamarin-android\src\Xamarin.Android.Build.Tasks\Tests\Xamarin.ProjectTools\Common\XamarinProject.cs:line 241
     at Xamarin.ProjectTools.ProjectBuilder.Save(XamarinProject project, Boolean doNotCleanupOnUpdate, Boolean saveProject) in C:\Users\Peter\source\xamarin-android\src\Xamarin.Android.Build.Tasks\Tests\Xamarin.ProjectTools\Common\ProjectBuilder.cs:line 43
     at Xamarin.ProjectTools.ProjectBuilder.Build(XamarinProject project, Boolean doNotCleanupOnUpdate, String[] parameters, Boolean saveProject, Dictionary`2 environmentVariables) in C:\Users\Peter\source\xamarin-android\src\Xamarin.Android.Build.Tasks\Tests\Xamarin.ProjectTools\Common\ProjectBuilder.cs:line 67
     at Xamarin.Android.Build.Tests.WearTests.ResolveLibraryImportsWithReadonlyFiles() in C:\Users\Peter\source\xamarin-android\src\Xamarin.Android.Build.Tasks\Tests\Xamarin.Android.Build.Tests\WearTests.cs:line 28

Rather than copying the version of the MSBuild assemblies used to build
our test projects to the output directory, we should be able to use the
NuGet package content directly.  These files should only be used by our
project creation APIs and as a result their version shouldn't matter.
@pjcollins pjcollins removed the do-not-merge PR should not be merged. label Apr 29, 2021
Copy link
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

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

This looks good if CI ends up green

jonathanpeppers added a commit to dotnet/java-interop that referenced this pull request Apr 30, 2021
Context: dotnet/android#5891
Context: dotnet/android@e59f649

xamarin-android should imminently be building libraries targeting `net6.0` instead of `netcoreapp3.1`.

We should be able to do this now, because Mono 6.12.0.137 supports building both .NET 5.0 and .NET 6.0.
jonathanpeppers added a commit to dotnet/java-interop that referenced this pull request Apr 30, 2021
Context: dotnet/android#5891
Context: dotnet/android@e59f649

xamarin-android should imminently be building libraries targeting `net6.0` instead of `netcoreapp3.1`.

We should be able to do this now, because Mono 6.12.0.137 supports building both .NET 5.0 and .NET 6.0.
jonathanpeppers added a commit to dotnet/java-interop that referenced this pull request Apr 30, 2021
Context: dotnet/android#5891
Context: dotnet/android@e59f649

xamarin-android should imminently be building libraries targeting `net6.0` instead of `netcoreapp3.1`.

We should be able to do this now, because Mono 6.12.0.137 supports building both .NET 5.0 and .NET 6.0.
jonathanpeppers added a commit to dotnet/java-interop that referenced this pull request Apr 30, 2021
Context: dotnet/android#5891
Context: dotnet/android@e59f649

xamarin-android should imminently be building libraries targeting `net6.0` instead of `netcoreapp3.1`.

We should be able to do this now, because Mono 6.12.0.137 supports building both .NET 5.0 and .NET 6.0.
jonathanpeppers added a commit to dotnet/java-interop that referenced this pull request Apr 30, 2021
Context: dotnet/android#5891
Context: dotnet/android@e59f649

xamarin-android should imminently be building libraries targeting `net6.0` instead of `netcoreapp3.1`.

We should be able to do this now, because Mono 6.12.0.137 supports building both .NET 5.0 and .NET 6.0.
@jonathanpeppers jonathanpeppers merged commit fefc151 into main Apr 30, 2021
@jonathanpeppers jonathanpeppers deleted the yaml-use-net-6 branch April 30, 2021 14:27
jonathanpeppers added a commit to dotnet/java-interop that referenced this pull request Apr 30, 2021
Context: dotnet/android#5891
Context: dotnet/android@e59f649

xamarin-android should imminently be building libraries targeting `net6.0` instead of `netcoreapp3.1`.

We should be able to do this now, because Mono 6.12.0.137 supports building both .NET 5.0 and .NET 6.0.
jonathanpeppers added a commit to dotnet/java-interop that referenced this pull request Apr 30, 2021
Context: dotnet/android#5891
Context: dotnet/android@e59f649

xamarin-android should imminently be building libraries targeting `net6.0` instead of `netcoreapp3.1`.

We should be able to do this now, because Mono 6.12.0.137 supports building both .NET 5.0 and .NET 6.0.
jonathanpeppers added a commit to dotnet/java-interop that referenced this pull request Apr 30, 2021
Context: dotnet/android#5891
Context: dotnet/android@e59f649

xamarin-android should imminently be building libraries targeting `net6.0` instead of `netcoreapp3.1`.

We should be able to do this now, because Mono 6.12.0.137 supports building both .NET 5.0 and .NET 6.0.
jonathanpeppers added a commit to dotnet/java-interop that referenced this pull request May 3, 2021
Context: dotnet/android#5891
Context: dotnet/android@e59f649

xamarin-android should imminently be building libraries targeting `net6.0` instead of `netcoreapp3.1`.

We should be able to do this now, because Mono 6.12.0.137 supports building both .NET 5.0 and .NET 6.0.
jonpryor pushed a commit to dotnet/java-interop that referenced this pull request May 5, 2021
Context: dotnet/android#5891
Context: dotnet/android@e59f649

xamarin/xamarin-android should imminently be building libraries
targeting `net6.0` instead of `netcoreapp3.1`.

We should be able to do this now, because Mono 6.12.0.137 supports
building both .NET 5.0 and .NET 6.0.

Update all appropriate `$(TargetFrameworks)` values so that `net6.0`
is used instead of `netcoreapp3.1`.

Update `global.json` so that a Prerelease .NET 6 SDK is used, and use
`boots` to install the preview version of Mono which supports
targeting `net6.0`.
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants