dotnet / dotnet/EntityFramework.Docs

How to pass MSBuild parameters when using the ef tools?

Open
#1,261 7 comments 5 reactions 0 assignees View on GitHub
area-tools
Dominant language
Mermaid
Stars
1.7k
Forks
2k
Avg merge
7d 23h
Merged PRs (30d)
16

Description

When you run the `dotnet ef` tools, they first call the `dotnet msbuild` tool. My projects require certain parameters to run properly; when I manually call `dotnet build`, I can pass them via the `-p` parameter, for example:

`dotnet build -p:MyParam=Whatever`.

How can I pass MSBuild parameters when calling `dotnet ef`?

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: 263f21d6-6edc-7582-e0e2-fa1c9670bcc0
* Version Independent ID: b3dd8c84-18b1-f98d-64f1-7897d1482692
* Content: [EF Core tools reference (.NET CLI) - EF Core](https://docs.microsoft.com/en-us/ef/core/miscellaneous/cli/dotnet#using-the-tools)
* Content Source: [entity-framework/core/miscellaneous/cli/dotnet.md](https://github.com/aspnet/EntityFramework.Docs/blob/master/entity-framework/core/miscellaneous/cli/dotnet.md)
* Product: **entity-framework**
* GitHub Login: @bricelam
* Microsoft Alias: **bricelam**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.