Skip to content

Conversation

@pjcollins
Copy link
Member

@pjcollins pjcollins commented May 20, 2022

Removes the need to have a .NET 7 preview installed globally to build.
A .NET 6 install is required to build and run xaprepare, which will
provision a .NET 7 preview build used for further building and testing.

Instructions to build on macOS remain unchanged:

make prepare
make all

or

make jenkins

Instructions to build on Windows have been updated:

dotnet msbuild -t:Prepare Xamarin.Android.sln
dotnet-local.cmd -t:PackDotNet Xamarin.Android.sln

The dotnet msbuild command is recommended as it will not attempt a
restore. This will allow the Prepare target to run against a .NET 6
install, even though Xamarin.Android.sln contains projects that target
net7.0. Otherwise, attempts to dotnet build any target belonging to
Xamarin.Android.sln with .NET 6 will fail during restore:

Project "C:\Users\Peter\source\pj\xamarin-android\Xamarin.Android.sln" on node 1 (Restore target(s)).
ValidateSolutionConfiguration:
  Building solution configuration "Debug|AnyCPU".
_GetAllRestoreProjectPathItems:
  Determining projects to restore...
Project "C:\Users\Peter\source\pj\xamarin-android\Xamarin.Android.sln" (1) is building "C:\Users\Peter\source\pj\xamarin-android\src\Microsoft.Android.Sdk.ILLink\Microsoft.Android.Sdk.ILLink.csproj" (11:4) on node 1 (_GenerateRestoreGraphProjectEntry target(s)).
C:\Program Files\dotnet\sdk\6.0.300\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0.  Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0.

@pjcollins
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines failed to run 1 pipeline(s).

@pjcollins pjcollins force-pushed the use-bin-dotnet branch 4 times, most recently from e603056 to 4e6a589 Compare May 22, 2022 21:17
@pjcollins pjcollins marked this pull request as ready for review May 23, 2022 23:21
@pjcollins pjcollins requested review from dellis1972 and grendello May 23, 2022 23:22
@pjcollins pjcollins merged commit ff7f467 into dotnet:main May 24, 2022
@pjcollins pjcollins deleted the use-bin-dotnet branch May 24, 2022 13:54
simonrozsival pushed a commit to simonrozsival/xamarin-android that referenced this pull request May 31, 2022
)

Removes the need to have a .NET 7 preview installed globally to build.
A .NET 6 install is required to build and run xaprepare, which will
provision a .NET 7 preview build used for further building and testing.

Instructions to build on macOS remain unchanged:

    make prepare
    make all

or

    make jenkins

Instructions to build on Windows have been updated:

    dotnet msbuild -t:Prepare Xamarin.Android.sln
    dotnet-local.cmd -t:PackDotNet Xamarin.Android.sln -m:1

The `dotnet msbuild` command is recommended as it will not attempt a
restore.  This will allow the `Prepare` target to run against a .NET 6
install, even though `Xamarin.Android.sln` contains projects that target
net7.0.  Otherwise, attempts to dotnet build any target belonging to
`Xamarin.Android.sln` with .NET 6 will fail during restore:

    Project "C:\Users\Peter\source\pj\xamarin-android\Xamarin.Android.sln" on node 1 (Restore target(s)).
    ValidateSolutionConfiguration:
      Building solution configuration "Debug|AnyCPU".
    _GetAllRestoreProjectPathItems:
      Determining projects to restore...
    Project "C:\Users\Peter\source\pj\xamarin-android\Xamarin.Android.sln" (1) is building "C:\Users\Peter\source\pj\xamarin-android\src\Microsoft.Android.Sdk.ILLink\Microsoft.Android.Sdk.ILLink.csproj" (11:4) on node 1 (_GenerateRestoreGraphProjectEntry target(s)).
    C:\Program Files\dotnet\sdk\6.0.300\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0.  Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.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.

4 participants