Caba_Sagi
(Čaba Šagi)
August 27, 2021, 4:22pm
2
Hello @Gokul1
I would like to welcome you to our community.
First of all I would like to suggest to you to change your token, as part of it is visible in the picture you posted.
Getting back to the issue you reported, it seems to me that dotnet has this problem, you can see that in all of these opened issues:
opened 07:16PM - 16 Jul 20 UTC
type-enhancement
customer-reported
area-tools
punted-for-6.0
Trying to figure out why using `dotnet ef` suddenly stopped working in our build… s, it looks like the `dotnet 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.
- Open a .net dev window to a random path (anything not .net related)
- Run `dotnet ef` (you should get what you would expect, that you need more arguments)
![Administrator_ Developer Command Prompt for VS 201 (1)](https://user-images.githubusercontent.com/67574/87712673-06f55b00-c777-11ea-994b-afbf882b5c24.png)
- Move to the root of a project where there are multiple .sln files
- Run `dotnet ef` again
![Administrator_ Developer Command Prompt for VS 201 (2)](https://user-images.githubusercontent.com/67574/87712725-1c6a8500-c777-11ea-8a90-5896a623b074.png)
Expected: 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
opened 07:41PM - 15 Feb 20 UTC
I've encountered a problem while trying to execute `dotnet ef migrations add [mi… gration_name]` command.
While creating new project in Visual Studio 2019, I've marked an option "Place solution and project in the same directory". Here is how my project structure looks like:
```
λ ls
App.razor Data/ Pages/ Shared/ appsettings.json docker-compose.override.yml
Areas/ Dockerfile Program.cs Startup.cs bin/ docker-compose.yml
BlazorApp1.csproj Dockerfile.original Properties/ _Imports.razor blazor_app.sln obj/
BlazorApp1.csproj.user Models/ Services/ appsettings.Development.json docker-compose.dcproj wwwroot/
```
When I try to execute above mentioned command, I receive this message:
> λ dotnet ef migrations add migrationname
> Specify which project file to use because this 'C:\Users\piotr\Desktop\webserver\blazor_app' contains more than one project file.
>
It makes sense, since I've got `BlazorApp1.csproj` and `docker-compose.dcproj` which are project files in the same folder. But at the same time there is no way to specify which project I want to use.
[People on the internet](https://stackoverflow.com/a/49367772/1804027) recommend to use `-p` and `-s` arguments, but [documentation says](https://docs.microsoft.com/en-us/ef/core/miscellaneous/cli/dotnet#common-options) that those arguments can specify path to the **project folder** not project file.
Nonetheless I tried to use them in such way, but with no luck.
> C:\Users\piotr\Desktop\webserver\blazor -> origin_app (blazor -> origin)
> λ dotnet ef -p BlazorApp1.csproj
> Specify which project file to use because this 'C:\Users\piotr\Desktop\webserver\blazor_app' contains more than one project file.
>
> C:\Users\piotr\Desktop\webserver\blazor -> origin_app (blazor -> origin)
> λ dotnet ef -p BlazorApp1.csproj -s BlazorApp1.csproj
> Specify which project file to use because this 'C:\Users\piotr\Desktop\webserver\blazor_app' contains more than one project file.
It's also worth noting I couldn't even view help to see possible parameters I could use because of this error:
```
λ dotnet ef --help
Specify which project file to use because this 'C:\Users\piotr\Desktop\webserver\blazor_app' contains more than one project file.
```
Summing up, a few things, in my opinion, should be fixed:
* add parameter to specify which project I want to use for migration
* OR remove "Place solution and project in the same directory" option from Visual Studio if it creates illegal project structure
* allow to view CLI help regardless of error
opened 11:27PM - 18 Sep 19 UTC
After installing and attempting to run, I'm consistently getting...
"Specify w… hich project file to use because this 'D:\ATLASSVN\Common\source\Utilities\Utilities' contains more than one project file."
My command line is: _dotnet migrate-2019 wizard "Utilities.csproj"_
The directory actually only contains one .csproj file. I've attached my .csproj file and a screenshot of my command window.
If there anything I'm obviously doing wrong?
[Utilities.csproj.zip](https://github.com/hvanbakel/CsprojToVs2017/files/3628713/Utilities.csproj.zip)
![2019-09-19 11_12_24-Common- Microsoft Visual Studio (Administrator)](https://user-images.githubusercontent.com/5687119/65193459-54f5ef80-dacf-11e9-8d3c-6dffd1bd709b.png)
What I can suggest to you to make it work is to make sure you have only one solution or project file in the folder you are trying to run the begin step for.
duncanp
(Duncan Pocklington)
November 12, 2021, 3:33pm
3