TheKazMan
TheKazMan

Reputation: 13

asp.net core web api project does not run

guys! I have an issue.

  1. I created .net core webapi project in vscode using terminal.

  2. Made following commands: dotnet restore, dotnet build, dotnet run.

  3. Unfortunately, project does not run. But When I run it in visual studio, it works.

I do not know where I am doing wrong enter image description here

Upvotes: 0

Views: 4904

Answers (2)

Mika Play
Mika Play

Reputation: 21

Please go under the properties folder of your project, open the launchSettings.json and look for ApplicationUrl under Profiles. You will find the exact port your project is using.

Upvotes: 2

Brijesh Shah
Brijesh Shah

Reputation: 655

I faced the same problem today and came across this post. Web API (Dotnet Core) Project works from Visual Studio but not through Dotnet CLI. However, Web App (Dotnet Core) Project works from Visual Studio as well as through Dotnet CLI. (simply I am executing dotnet {webapp.dll} - without curley braces)

After a few trial-error as well as documentation from Microsoft I tried dotnet run "{dll}" and that works for me.
I have tried that for Web App + Web API (Dotnet Core) and both are working.

I know this is a very late reply but worth of adding my comments as it might worth of solving someone's problem, if not yours.

Upvotes: 0

Related Questions