C#C
C#7mo ago
8 replies
peppy

<ExcludeAssets>runtime</> seemingly ignored in plugin projects when compiling for specific RID

I have a plugin framework in which the base project references a NuGet package with runtimes/{RID}/native components.
    <ItemGroup>
        <PackageReference Include="Hexa.NET.ImGui.Backends" Version="1.0.15" />
    </ItemGroup>

Both the plugin base and plugins are built with:
    <PropertyGroup>
        <TargetFramework>net9.0</TargetFramework>
        <ImplicitUsings>disable</ImplicitUsings>
        <Nullable>enable</Nullable>
        <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
        <RuntimeIdentifier>win-x86</RuntimeIdentifier>
        <EnableDynamicLoading>true</EnableDynamicLoading>
    </PropertyGroup>

and the plugins declare their ref to the plugin base as:
    <ItemGroup>
        <ProjectReference Include="..\..\base\core\Fahrenheit.Core.csproj">
            <Private>false</Private>
            <ExcludeAssets>runtime</ExcludeAssets>
        </ProjectReference>
    </ItemGroup>

yet both the base and all plugins receive individual copies of the runtime DLLs for win-x86! Is <ExcludeAssets>runtime</ExcludeAssets> insufficient here or does the base project need some additional directive here?
Was this page helpful?