Open
Description
Describe the bug
When publishing a native AOT library that has a ProjectReference to another class library, the other class library's managed .pdb symbols are being published along size the native AOT library. These are unnecessary files and should be excluded by default.
To Reproduce
Given 2 projects:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<InvariantGlobalization>true</InvariantGlobalization>
<PublishAot>true</PublishAot>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\AnotherClassLib\AnotherClassLib.csproj" />
</ItemGroup>
</Project>
using AnotherClassLib;
using System.Runtime.InteropServices;
namespace MyLibrary;
public static class EntryPoints
{
[UnmanagedCallersOnly(EntryPoint = "MyValidate")]
public static int MyValidate()
{
Class1 c = new();
c.Method();
return 1;
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
namespace AnotherClassLib;
public class Class1
{
public void Method()
{
Console.WriteLine("Hello from a method");
}
}
dotnet publish -r win-x64
the first project and inspect the publish folder.
The AnotherClassLib.pdb
file shouldn't be there. It is unnecessary.
Exceptions (if any)
N/A