Skip to content

dotnet-publish with --use-current-rid or --infer-rid option #10449

Closed
@am11

Description

@am11

At present:

dotnet publish -c Release path/code -o path/app /p:PublishSingleFile=true

throws error:

error NETSDK1031: It is not supported to build or publish a self-contained application without specifying a RuntimeIdentifier. Please either specify a RuntimeIdentifier or set SelfContained to false.

which requires a fix like:

dotnet publish -c Release path/code -o path/app /p:PublishSingleFile=true -r osx-x64

It is fairly a common usecase to publish an app for platform with same RID as host.

However, the error is good to keep it an explicit and conscious decision of user; instead of falling back to some default value.

Please add --use-current-rid or --infer-rid option for automation and documentation convenience.

This way user will still explicitly specify RID option, without supplying platform specific value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions