You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dotnet new console
dotnet publish -r win-x64 -p:PublishReadyToRun=true -p:PublishReadyToRunUseCrossgen2=true
which outputs:
Microsoft (R) Build Engine version 16.9.0-preview-21103-02+198f3f262 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
Restored C:\test\test\test.csproj (in 110 ms).
You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
test -> C:\test\test\bin\Debug\net6.0\win-x64\test.dll
C:\Program Files\dotnet\sdk\6.0.100-preview.1.21103.13\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(399,5): error : Could not resolve CoreCLR path. For more details, enable tracing by setting COREHOST_TRACE environment variable to 1 [C:\test\test\test.csproj]
C:\Program Files\dotnet\sdk\6.0.100-preview.1.21103.13\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(297,5): error NETSDK1096: Optimizing assemblies for performance failed. You can either exclude the failing assemblies from being optimized, or set the PublishReadyToRun property to false. [C:\test\test\test.csproj]
But if I change the target framework to net5.0, it will compile.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I typed:
which outputs:
But if I change the target framework to net5.0, it will compile.
This is the output when I set COREHOST_TRACE:
https://gist.githubusercontent.com/imba-tjd/aa4ee703f848692265e00ede29d42c31/raw/crossgen2_err.txtI have installed preview 2 and this issue disappeared.
Beta Was this translation helpful? Give feedback.
All reactions