Add support for file-based apps to dotnet-ef tools#38157
Add support for file-based apps to dotnet-ef tools#38157AndriySvyryd merged 9 commits intodotnet:mainfrom
Conversation
|
@jjonescz can you please open an issue clearly detailing what this is meant to fix? |
There was a problem hiding this comment.
Pull request overview
This PR adds first-class support in dotnet-ef for “file-based apps” (single .cs files) by allowing users to point tooling at a .cs file and ensuring metadata extraction works for those inputs.
Changes:
- Add a
--fileoption (mutually exclusive with--project) and resolve it when selecting the project path. - Switch MSBuild metadata extraction to use
dotnet build(instead ofdotnet msbuild) when the input is a.csfile. - Add a new test validating build/metadata extraction for a file-based app.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/dotnet-ef.Tests/FileBasedAppTest.cs | New test covering metadata extraction and build output for a .cs file-based app. |
| src/dotnet-ef/RootCommand.cs | Adds --file handling and mutual exclusion logic with --project. |
| src/dotnet-ef/Properties/Resources.resx | Adds new option/error strings and updates option descriptions. |
| src/dotnet-ef/Properties/Resources.Designer.cs | Updates strongly-typed resource accessors for new strings. |
| src/dotnet-ef/ProjectOptions.cs | Adds the --file command-line option. |
| src/dotnet-ef/Project.cs | Uses dotnet build (vs dotnet msbuild) for .cs inputs during metadata extraction. |
Files not reviewed (1)
- src/dotnet-ef/Properties/Resources.Designer.cs: Language not supported
|
I think we shouldn't introduce |
|
Right, so you are saying we should accept |
Yes. We could add --file and --startup-file as synonyms, I just think that would be confusing for users familiar with dotnet-ef |
|
Filed #38159 to decide which direction we should go |
Resolves #38158.