Docs: -p:PublishReadyToRun isn't allowed in 3.1?

Created on 20 Apr 2020  Â·  4Comments  Â·  Source: dotnet/docs

Attempting to use this on the command line fails, with the following error

MSBUILD : error MSB1006: Property is not valid.
Switch: PublishReadyToRun

Not clear whether this is an error on this page, or an inadequate error message which doesn't explain what the actual problem is.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Area - .NET Core Guide Technology - CLI P1 doc-bug

Most helpful comment

Thanks, I tried that and it got past the command line validation but my command

dotnet publish --runtime win-x86 /p:PublishReadyToRun=true

Then failed with the following message:

/usr/local/share/dotnet/sdk/3.1.201/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Publish.targets(272,5): error NETSDK1095: Optimizing assemblies for performance is not supported for the selected target platform or architecture. Please verify you are using a supported runtime identifier, or set the PublishReadyToRun property to false.

I thought I was just asking it to publish a read-to-run executable, not optimising for performance. I do wonder whether running the command on a mac but targeting win-x86 is causing a problem (although nothing in the documentation suggests that should be problematic)

I'm having similar issue using SDK 3.1.402 with the following command and error. I also noticed that "ReadyToRun" option is only available when publish a win-x runtime app in Publish GUI under VS. Is it not supported for Linux runtime anymore? We need this option as our application would only work in dotNet Core using this option for some reason.

dotnet publish -r linux-x64 -c Release -p:PublishReadyToRun=true -p:PublishSingleFile=true --self-contained

C:\Program Files\dotnet\sdk\3.1.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(258,5): error NETSDK1095: Optimizing assemblies for performance is not supported for the selected target platform or architecture. Please verify you are using a supported runtime identifier, or set the PublishReadyToRun property to false. [C:\Workspace\Pivot\Otpp.Pivot.Core.NetCore\ScenarioApp\ScenarioApp.csproj]

All 4 comments

try -p:PublishReadyToRun=true -- I'll update the documentation.

Thanks, I tried that and it got past the command line validation but my command

dotnet publish --runtime win-x86 /p:PublishReadyToRun=true

Then failed with the following message:

/usr/local/share/dotnet/sdk/3.1.201/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Publish.targets(272,5): error NETSDK1095: Optimizing assemblies for performance is not supported for the selected target platform or architecture. Please verify you are using a supported runtime identifier, or set the PublishReadyToRun property to false.

I thought I was just asking it to publish a read-to-run executable, not optimising for performance. I do wonder whether running the command on a mac but targeting win-x86 is causing a problem (although nothing in the documentation suggests that should be problematic)

Thanks, I tried that and it got past the command line validation but my command

dotnet publish --runtime win-x86 /p:PublishReadyToRun=true

Then failed with the following message:

/usr/local/share/dotnet/sdk/3.1.201/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Publish.targets(272,5): error NETSDK1095: Optimizing assemblies for performance is not supported for the selected target platform or architecture. Please verify you are using a supported runtime identifier, or set the PublishReadyToRun property to false.

I thought I was just asking it to publish a read-to-run executable, not optimising for performance. I do wonder whether running the command on a mac but targeting win-x86 is causing a problem (although nothing in the documentation suggests that should be problematic)

I'm having similar issue using SDK 3.1.402 with the following command and error. I also noticed that "ReadyToRun" option is only available when publish a win-x runtime app in Publish GUI under VS. Is it not supported for Linux runtime anymore? We need this option as our application would only work in dotNet Core using this option for some reason.

dotnet publish -r linux-x64 -c Release -p:PublishReadyToRun=true -p:PublishSingleFile=true --self-contained

C:\Program Files\dotnet\sdk\3.1.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(258,5): error NETSDK1095: Optimizing assemblies for performance is not supported for the selected target platform or architecture. Please verify you are using a supported runtime identifier, or set the PublishReadyToRun property to false. [C:\Workspace\Pivot\Otpp.Pivot.Core.NetCore\ScenarioApp\ScenarioApp.csproj]

There's a new article about ReadyToRun - see its Cross platform/architecture restrictions section https://docs.microsoft.com/en-us/dotnet/core/deploying/ready-to-run#cross-platformarchitecture-restrictions

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mekomlusa picture mekomlusa  Â·  3Comments

stanuku picture stanuku  Â·  3Comments

ike86 picture ike86  Â·  3Comments

garfbradaz picture garfbradaz  Â·  3Comments

JagathPrasad picture JagathPrasad  Â·  3Comments