-
-
Notifications
You must be signed in to change notification settings - Fork 768
Add PublishReadyToRun to DotNetRestoreSettings #4109
Description
Discussed in https://github.com/orgs/cake-build/discussions/4108
Originally posted by Trisped January 19, 2023
According to https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/6.0/publish-readytorun-requires-restore-change#recommended-action :
In .NET 6, dotnet restore followed by dotnet publish -p:PublishReadyToRun=true --no-restore will fail with the NETSDK1095 error. This is because the crossgen binary is now shipped as a separate NuGet package, and so needs to be part of the restore operation for publishing to succeed.
According to https://cakebuild.net/api/Cake.Common.Tools.DotNet.Restore/DotNetRestoreSettings/ , there is not a PublishReadyToRun property like there is in DotNetPublishSettings.
There is a work around (set NoRestore to false), but it requires restoring twice, if you have already restored (for example, so you could test before publishing).