Skip to content

Add PublishReadyToRun to DotNetRestoreSettings #4109

@augustoproiete

Description

@augustoproiete

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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions