techquestions
techquestions

Reputation: 51

how to compile dotnet project if you have more than one project or more than one .cs file in the same folder

I use:

dotnet run

Getting following error after running given command:

Specify which project file to use because /home/payal/Downloads/OPCUA-Azure-IoTHub-GW-master/SampleApplications/Samples/NetCoreConsoleClient contains more than one project file.

Upvotes: 3

Views: 6060

Answers (1)

kuskmen
kuskmen

Reputation: 3775

You can run specific project by adding --project to dotnet run.

Example: dotnet run —project YourProjectName.csproj (when executing the command in the same directory your project is, otherwise denote the full path of the location of the project)

Source: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-run?tabs=netcore21

Upvotes: 5

Related Questions