Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameterize directories used by dotnet-ef #5680

Merged
merged 1 commit into from
Jun 8, 2016

Conversation

natemcmaster
Copy link
Contributor

Fix #5311 by adding back --startup-project.

NB: using --startup-project requires that "Microsoft.EntityFrameworkCore.Design" be installed startup project, not the current project. This partially enables class libraries. cref #5320

TODO: parameter order on command line still matters, so this option must be added between "ef" and the next sub command. E.g. dotnet ef --startup-project ../WebApp1 database update. This is already tracked in #5188

This is built under the assumption that on .NET Core CLI, the current working directory is your target project, and is not necessarily the startup project. The reverse assumption (that dotnet-ef should always be executed on startup) is not consistent with other .NET Core CLI commands that alter files.

Worth noting: we are still using relative project directories as the value of --startup-project. This is to stay consistent with how .NET Core CLI handles preferences to projects. (Example see dotnet run --help)

cc @bricelam @divega @rowanmiller

@natemcmaster
Copy link
Contributor Author

(PS, before I request ask-mode approval, let's consider first that this is the behavior we want.)

@bricelam
Copy link
Contributor

bricelam commented Jun 8, 2016

Wonderful! It's exactly how I always wanted it to work.

"The folder to use as the project directory. If not specified, the current working is used."),
"The folder used as the project directory. If not specified, the current working directory is used."),
StartupTargetDirectory = app.Option(StartupTargetDirectoryOptionTemplate + " <DIR>",
"The folder used as the base directory for ASP.NET hosting environment. If not specified, the current working directory is used."),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't ASP.NET-specific. Maybe something like "...base directory for the application."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we drop the data directory and merge them into one parameter? I can't think of a scenario in which data directory is different from the app base path.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Classic ASP.NET uses <base>/App_Data

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But yes, it's probably OK to do that for now on CLI.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm going to leave it, as long as there is the possible scenario that data directory may not be the app base path.

@bricelam
Copy link
Contributor

bricelam commented Jun 8, 2016

:shipit:

@natemcmaster natemcmaster force-pushed the startup-proj branch 2 times, most recently from 666ae09 to dfeb298 Compare June 8, 2016 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants