DapperLib / DapperAOT

Build time tools in the flavor of Dapper
Other
349 stars 19 forks source link

Dapper.AOT not executing when building #113

Closed ADringer closed 4 months ago

ADringer commented 4 months ago

Describe the bug

Hi, I've followed the getting started guide but am failing at the first step. I've added Dapper.AOT to my project but upon building I don't get any extra build messages as expected.

To Reproduce This is a minimal api project and my csproj file looks like this:

<Project Sdk="Microsoft.NET.Sdk.Web">

    <PropertyGroup>
        <TargetFramework>net8.0</TargetFramework>
        <Nullable>enable</Nullable>
        <ImplicitUsings>enable</ImplicitUsings>
        <InvariantGlobalization>true</InvariantGlobalization>
        <PublishAot>true</PublishAot>
        <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
        <DockerfileContext>..\..</DockerfileContext>
        <AssemblyName>Me.MelCloudHome.$(MSBuildProjectName)</AssemblyName>
        <RootNamespace>Me.MelCloudHome.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
        <UserSecretsId>1fcb746d-853b-4f16-960b-037b5576c67e</UserSecretsId>
        <AssemblyName>bootstrap</AssemblyName>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="Amazon.Lambda.AspNetCoreServer.Hosting" Version="1.7.0" />
        <PackageReference Include="Dapper" Version="2.1.35" />
        <PackageReference Include="Dapper.AOT" Version="1.0.31" />
        <PackageReference Include="LES.Shared.SecretsManager" Version="1.0.0-CI-20240104-110819" />
        <PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.2" />
        <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.6" />
        <PackageReference Include="MySqlConnector" Version="2.3.5" />
        <PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
    </ItemGroup>

    <ItemGroup>
        <ProjectReference Include="..\HvacSystemsService.SharedModel\HvacSystemsService.SharedModel.csproj" />
    </ItemGroup>

</Project>

I've had a look at what examples are around but can't see anything obvious - it seems like I should get build warnings just by adding the project.

Thanks

ADringer commented 4 months ago

I'm closing this as although I'm not seeing build warnings as documented, I can see some warnings generated after I open the file so it is working