You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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).
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 :
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).