Commit 1b7971d
authored
Add error for incorrect aot publish (#46070)
For the following project (note it uses the nativeaot runtime pack):
```xml
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PublishAot>true</PublishAot>
<PublishAotUsingRuntimePack>true</PublishAotUsingRuntimePack>
<SelfContained>true</SelfContained>
</PropertyGroup>
</Project>
```
This command produces an error:
```
> dotnet build -t:Publish
Restore complete (0.6s)
You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
project failed with 2 error(s) (0.7s) → bin/Debug/net10.0/linux-x64/project.dll
EXEC : error : Failed to load assembly 'System.Private.StackTraceMetadata'
.nuget/packages/microsoft.dotnet.ilcompiler/10.0.0-alpha.1.25052.4/build/Microsoft.NETCore.Native.targets(316,5): error MSB3073: The command "".nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/10.0.0-alpha.1.25052.4/tools/ilc" @"obj/Debug/net10.0/linux-x64/native/project.ilc.rsp"" exited with code 1.
```
This is due to ILC being passed assemblies from the coreclr runtime
pack (which doesn't include S.P.StackTraceMetadata) instead of the
nativeaot framework assemblies.
This adds a better error message for this unsupported scenario.1 parent 1a0425f commit 1b7971d
File tree
15 files changed
+76
-2
lines changed- src/Tasks
- Common/Resources
- xlf
- Microsoft.NET.Build.Tasks/targets
15 files changed
+76
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
977 | 977 | | |
978 | 978 | | |
979 | 979 | | |
980 | | - | |
981 | 980 | | |
982 | 981 | | |
983 | 982 | | |
984 | 983 | | |
985 | | - | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
986 | 989 | | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments