-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Open
Labels
Milestone
Description
Description
If the project has multiple targets, then the Aot build does not work.
Reproduction Steps
Project
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0-windows;net46</TargetFrameworks>
</PropertyGroup>
</Project>
Run command
dotnet publish -r win-x64 -f net8.0-windows -c Release -p:PublishAot=true
Expected behavior
build aot
Actual behavior
Error:
Определение проектов для восстановления...
C:\Program Files\dotnet\sdk\8.0.400\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(90,5): error NETSDK1207: AOT-компиляция не поддерживается целевой платформой. [d:\GIT\Test\AudioAot\AudioAot.csproj::TargetFramework=net46]
Regression?
No response
Known Workarounds
Change Project to single Target
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
</PropertyGroup>
</Project>
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status