Sam
Sam

Reputation: 30388

Couldn't find a project to run. Ensure a project exists in D:\home\site\wwwroot

I've been wrestling with this issue forever now. I'm trying to get my ASP.NET Core 2.1 app to run on Azure App Service.

Here's the strange behavior I'm seeing in Kudu.

I see the dll file for my project in Kudu console in D:\home\site\wwwroot. I then type dotnet run myproject.dll and I get the following error:

Couldn't find a project to run. Ensure a project exists in D:\home\site\wwwroot

Any idea what's going on here?

Upvotes: 51

Views: 97051

Answers (5)

vml19
vml19

Reputation: 3864

In case of MacBook, it is the same way as well, for example:

dotnet ../../bin/Debug/net7.0/yourprojectname.dll

Upvotes: 0

Furqan S. Mahmoud
Furqan S. Mahmoud

Reputation: 1455

The solution consists of one or several projects, and thedotnetcommand is used in the context of projects, hence: you need first to change the directory to the project folder then run the command:

cd ProjectName
dotnet run       // or even "dotnet add package <Package Name>"

Upvotes: 8

david myers
david myers

Reputation: 331

I was having the same issue. Not sure if this is a work-around but it ran the code.

dotnet run --project name-of-your-project-here

Upvotes: 33

Roshan Singh
Roshan Singh

Reputation: 41

Go to the path of your dll and run it using the following command:

dotnet yourprojectname.dll

Upvotes: 4

Marcus H&#246;glund
Marcus H&#246;glund

Reputation: 16801

From the docs

The dotnet run command is used in the context of projects, not built assemblies. If you're trying to run a framework-dependent application DLL instead, you must use dotnet without a command.

So try and run it like this

dotnet myproject.dll

Upvotes: 79

Related Questions