Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable implicit RID with --sc #21405

Closed
richlander opened this issue Sep 25, 2021 · 4 comments · Fixed by #22314
Closed

Enable implicit RID with --sc #21405

richlander opened this issue Sep 25, 2021 · 4 comments · Fixed by #22314
Assignees
Labels
Milestone

Comments

@richlander
Copy link
Member

richlander commented Sep 25, 2021

The new --sc syntax works for self-contained apps, per #19681.

It still requires a RID. Let's enable it to work with the implicit SDK RID so that we don't create a breaking change in .NET 7. This argument is new. It also will enable users to get around the new warning with -r.

This change is some really nice fit-and-finish for .NET 6. This behavior is the original intent of #19576.

This is the behavior with RC2.

rich@MacBook-Air-M1-2020 app % dotnet build --sc
Microsoft (R) Build Engine version 17.0.0-preview-21470-01+cb055d28f for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
/usr/local/share/dotnet/sdk/6.0.100-rc.2.21473.35/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(150,5): error NETSDK1031: It is not supported to build or publish a self-contained application without specifying a RuntimeIdentifier. You must either specify a RuntimeIdentifier or set SelfContained to false. [/Users/rich/app/app.csproj]

Build FAILED.

/usr/local/share/dotnet/sdk/6.0.100-rc.2.21473.35/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(150,5): error NETSDK1031: It is not supported to build or publish a self-contained application without specifying a RuntimeIdentifier. You must either specify a RuntimeIdentifier or set SelfContained to false. [/Users/rich/app/app.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:02.03
rich@MacBook-Air-M1-2020 app % dotnet build --sc -r osx-arm64
Microsoft (R) Build Engine version 17.0.0-preview-21470-01+cb055d28f for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  Restored /Users/rich/app/app.csproj (in 180 ms).
  You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
  app -> /Users/rich/app/bin/Debug/net6.0/osx-arm64/app.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:06.09
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-CLI untriaged Request triage from a team member labels Sep 25, 2021
@sfoslund sfoslund added needs team triage Requires a full team discussion and removed untriaged Request triage from a team member labels Sep 29, 2021
@marcpopMSFT marcpopMSFT added this to the 6.0.2xx milestone Sep 29, 2021
@marcpopMSFT
Copy link
Member

@richlander I moved this to 6.0.2xx since we're closing down on 1xx. I don't see it as a breaking change to enable this in 2xx since it's loosening the limitations of the CLI. Let me know if you disagree.

@marcpopMSFT marcpopMSFT removed the needs team triage Requires a full team discussion label Sep 29, 2021
@richlander
Copy link
Member Author

It'd be really nice to get this in .100 to make it easier for folks to deal with NETSDK1179. They go together very nicely.

We're also not done with NET1179 #21560

That said, if we cannot make it, .200 is fine. Yes, you are right. It isn't breaking. I was wrong about that.

@sfoslund
Copy link
Member

@richlander looking at this more closely, the error you're seeing here is NETSDK1031, not NETSDK1179.

We plan on enabling implicit RIDs for the --self-contained option in .NET 7 anyway, right? So this issue is asking to enable it in 6.0.2xx for only the shorthand version of the option (--sc) and not the longhand (--self-contained)? I think this would be very confusing behavior, since it would be the only option in our entire CLI for which we have different behavior depending on if the short or longhand version of the option is used.

Further, the actual change to enable implicit RIDs will be simple if we're not differentiating between the long and shorthand options, but it would get significantly more complex to only have this behavior for the shorthand option.

@richlander richlander modified the milestones: 6.0.2xx, 7.0.1xx Oct 19, 2021
@richlander
Copy link
Member Author

Fair enough. Let's make the change in .NET 7 as you say. I changed the milestone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants