Reputation: 13
guys! I have an issue.
I created .net core webapi project in vscode using terminal.
Made following commands: dotnet restore, dotnet build, dotnet run.
Unfortunately, project does not run. But When I run it in visual studio, it works.
I do not know where I am doing wrong
Upvotes: 0
Views: 4904
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
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