MSBuild SDK for EF Core Power Tools CLI integration. Use as a project SDK for the simplest setup: <Project Sdk="JD.Efcpt.Sdk/1.0.0">. Automate database-first EF Core model generation as part of your build pipeline with zero configuration.
$ dotnet add package JD.Efcpt.SdkMSBuild integration for EF Core Power Tools CLI
Automate database-first EF Core model generation during dotnet build. Zero manual steps, full CI/CD support, reproducible builds.
dotnet new install JD.Efcpt.Build.Templates
dotnet new efcptbuild --name MyDataProject
dotnet build
<Project Sdk="JD.Efcpt.Sdk/0.15.16">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</Project>
dotnet add package JD.Efcpt.Build
dotnet build
.NET 8-9 users: Install the CLI tool first:
dotnet tool install -g ErikEJ.EFCorePowerTools.Cli --version "10.*".NET 10+ users: No tool installation needed - uses
dnxautomatically.
| Package | Purpose | Usage |
|---|---|---|
| JD.Efcpt.Build | MSBuild integration | Add as PackageReference |
| JD.Efcpt.Sdk | SDK package (cleanest setup) | Use as project SDK |
| JD.Efcpt.Build.Templates | Project templates | dotnet new install |
dotnet build| Topic | Description |
|---|---|
| Getting Started | Installation and first project setup |
| Using the SDK | SDK approach for cleanest project files |
| Configuration | MSBuild properties and JSON config options |
| Connection String Mode | Generate from live databases |
| T4 Templates | Customize code generation |
| CI/CD Integration | GitHub Actions, Azure DevOps, Docker |
| Troubleshooting | Common issues and solutions |
| API Reference | Complete MSBuild properties and tasks |
| Core Concepts | How the build pipeline works |
| Architecture | Internal architecture details |
dnx on .NET 10+; requires manual install on .NET 8-9| Type | Extension | Cross-Platform |
|---|---|---|
| Microsoft.Build.Sql | .sqlproj | Yes |
| MSBuild.Sdk.SqlProj | .csproj / .fsproj | Yes |
| Traditional SQL Projects | .sqlproj | Windows only |
Automatically generate SQL scripts from your live database when JD.Efcpt.Build detects it's referenced in a SQL project:
DatabaseProject (SQL):
<Project Sdk="MSBuild.Sdk.SqlProj/3.3.0">
<PropertyGroup>
<EfcptConnectionString>Server=...;Database=MyDb;...</EfcptConnectionString>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="JD.Efcpt.Build" Version="0.15.16" />
</ItemGroup>
</Project>
DataAccessProject (EF Core):
<ItemGroup>
<ProjectReference Include="..\DatabaseProject\DatabaseProject.csproj" />
<PackageReference Include="JD.Efcpt.Build" Version="0.15.16" />
</ItemGroup>
This enables the complete two-project workflow:
Live Database → SQL Scripts (in SQL Project) → DACPAC → EF Core Models (in DataAccess Project)
Benefits:
dnx (no sqlpackage installation required)See the Database-First SQL Generation sample for a complete example.
See the samples directory for complete working examples:
Contributions are welcome! Please open an issue first to discuss changes. See CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License. See LICENSE for details.