C#C
C#2y ago
Caedrius

Directory.Packages.props working for all projects except Api

I have the following Directory.Packages.props in my solution:
<Project>

    <ItemGroup Condition="$(MSBuildProjectname.EndsWith('Api'))">
        <PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="8.0.2"/>
        <PackageVersion Include="Swashbuckle.AspNetCore.Swagger" Version="6.4.0"/>
    </ItemGroup>

    <ItemGroup Condition="$(MSBuildProjectName.EndsWith('BuildingBlocks.Domain'))">
        <PackageVersion Include="MediatR" Version="12.2.0" />
    </ItemGroup>

    <ItemGroup Condition="$(MSBuildProjectName.EndsWith('BuildingBlocks.Application'))">
        <PackageVersion Include="FluentValidation" Version="11.8.1" />
        <PackageVersion Include="Serilog.AspNetCore" Version="8.0.1" />
    </ItemGroup>

    <ItemGroup Condition="$(MSBuildProjectName.EndsWith('BuildingBlocks.Infrastructure'))">
        <PackageVersion Include="Autofac" Version="7.1.0" />
        <PackageVersion Include="Autofac.Extensions.DependencyInjection" Version="8.0.0" />
        <PackageVersion Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
        <PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
        <PackageVersion Include="Polly" Version="8.2.0" />
    </ItemGroup>

</Project>


It works as expected for all projects in my solution expect my Api project. Any clues why?
image.png
Was this page helpful?