Why doesn't the "any" option work for the "-r" flag of .NET publish?

Calin Baenen - Feb 24 '21 - - Dev Community

I read in this doc about the any RID, and it's the root for all other RIDs.
So, I try to use it to target all RIDs in the command

dotnet publish -c Release -r any --self-contained true
Enter fullscreen mode Exit fullscreen mode

And it throws the following error(s):

C:\Program Files (x86)\dotnet\sdk\5.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(99,5): error NETSDK1084: There is no application host available for the specified RuntimeIdentifier 'any'. [C:\Users\Administrator\Desktop\Projects\C#\langs\Janky\language\language.csproj]
C:\Program Files (x86)\dotnet\sdk\5.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(99,5): error NETSDK1084: There is no application host available for the specified RuntimeIdentifier 'any'. [C:\Users\Administrator\Desktop\Projects\C#\langs\Janky\language\language.csproj]
C:\Program Files (x86)\dotnet\sdk\5.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(99,5): error NETSDK1084: There is no application host available for the specified RuntimeIdentifier 'any'. [C:\Users\Administrator\Desktop\Projects\C#\langs\Janky\language\language.csproj]
C:\Program Files (x86)\dotnet\sdk\5.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(99,5): error NETSDK1084: There is no application host available for the specified RuntimeIdentifier 'any'. [C:\Users\Administrator\Desktop\Projects\C#\langs\Janky\language\language.csproj]
Enter fullscreen mode Exit fullscreen mode

(idk why it does it 4 times.)

So, how can I use any?
If I can't, is there any way to target all runtimes?
What is the default value of -r? And why can't I have a self-contained application w/o specifying a runtime?

If I can't have a self contained application w/o a specified runtime (because that may be equal to any), is there any way to get around it?

Thanks!
Cheers!

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .