Open Quake4 opened 1 month ago
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas See info in area-owners.md if you want to be subscribed.
C:\Program Files\dotnet\sdk\8.0.400\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targe ts(90,5): error NETSDK1207: Ahead-of-time compilation is not supported for the target framework. [C:\repro\repro.csproj ::TargetFramework=net46]
This is currently by-design. The fix is to avoid setting PublishAot
via -p
as that will apply to all target frameworks.
Instead, put the following in your project file:
<PublishAot Condition="'$(TargetFramework)' != 'net46'">true</PublishAot>
Now AOT will be skipped for net46, where it is not supported.
Then what is the meaning of the -f key? This is an indication of the target platform. Where is the logic?
Description
If the project has multiple targets, then the Aot build does not work.
Reproduction Steps
Project
Run command
dotnet publish -r win-x64 -f net8.0-windows -c Release -p:PublishAot=true
Expected behavior
build aot
Actual behavior
Error:
Regression?
No response
Known Workarounds
Change Project to single Target
Configuration
net8 windows10 x64 no no
Other information
And check main project with reference to project with other
common (netstandard2.0)
targets:<TargetFrameworks>netstandard2.0;net46</TargetFrameworks>
It should also compile correctly.