8000 dotnet restore Multi Target Cli Standarization · Issue #49661 · dotnet/sdk · GitHub
[go: up one dir, main page]

Skip to content
dotnet restore Multi Target Cli Standarization #49661
Open
@tjwald

Description

@tjwald

Is your feature request related to a problem? Please describe.

I am developing an app that can be deployed both in dotnet 9 and 10.
The build & publish template gets as a parameter the dotnet version, but different steps use different syntax to set the target runtime.

dotnet restore -p:TargetFramework=net9.0 "path/to/app.csproj"
dotnet build --framework "path/to/app.csproj"
dotnet publish --framework net9.0

Why can't I use --framework for all of them?

Also, If I try to use the dotnet 9 sdk image to build the project, the restore fails even with the -p:TargetFramework=net9.0 flag set.

Describe the solution you'd like

dotnet restore will respect the --framework flag, and will not fail when the flag is provided and other unsupported target frameworks exist.

Additional context

For someone who is learning how to publish dotnet artifacts this makes it just a bit more difficult to learn.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0