-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Multiple solution file confusion issue #21655
Comments
I think the problem occurs when where are multiple csproj-files in the same folder. It is easy to reproduce this problem by cloning this repro: https://github.com/pekspro/EfMigrationIssue21655 If I am in the folder C:\EfMigrationIssue21655 and run:
it works fine. But if I am in the folder C:\EfMigrationIssue21655\NetCore3.1TestApplication and run
I get the error message: Specify which project file to use because this 'C:\Users\msn\source\repos\EfMigrationIssue21655\NetCore3.1TestApplication' contains more than one project file. Since the project is specified this is not expected. |
/cc @bricelam Heads-up for triage |
We should look at making the help commands a bit lazier--they certainly don't need a project. The fix for #11330 was supposed to prevent the second command from failing. Maybe it didn't get fixed for this case... |
Oh funny, looks like I said it should throw for this case in the PR (#13294). We should re-discuss. |
I mean, in this case @bricelam I'm obviously not doing something useful - just intentionally trying to get the help. I'm only doing it this way to simply show the issue, but I'm getting failing builds when running the following from the default working directory:
All this suddenly started failing on July 10th. I can mitigate it by setting the working directory to be something that doesn't break here, but it didn't make much sense that it fails in this specific case since I'm not working with projects in the local directory but I'm specifying project paths directly. |
Splitting off the @kfrancis This is the behavior:
Putting this on the backlog to generate a clearer message/better logging in this case. |
Update https://stackoverflow.com/questions/49342893 when this is fixed. That's the first hit when searching for this error. |
Just ran into this on our pipeline after upgrading to .NET 5.0
Edit: I added |
Seems like using dotnet ef migrations add RemovedEmailColumn -p "React - Backup.csproj" --startup-project "React.csproj" Followed this answer Stackoverflow |
How is this still not fixed yet in v7.0.9? |
v8.0.5 - too Projects
Project have
how fix - move up to parent directory with "cd .." and add to your command properties "project" and "startup-project", a your new relative path to csproj file |
Trying to figure out why using
dotnet ef
suddenly stopped working in our builds, it looks like thedotnet ef
command acts differently depending on where you run it.Steps to reproduce
I was originally trying to debug this on devops, but I can easily see this locally.
dotnet ef
(you should get what you would expect, that you need more arguments)dotnet ef
againExpected: The same thing should happen, the tool should respond asking for more arguments
Actual: The message "Specify which project file to use because this '(whatever your path is)' contains more than one project file" is shown.
Further technical details
EF Core version: I tried this all the way back to 3.1.0 and could see the same issue.
Database provider: n/a
Target framework: .NET Core 3.1.x
Operating system: Microsoft Windows [Version 10.0.18363.959]
IDE: n/a
The text was updated successfully, but these errors were encountered: