I\'m attempting to create a Web API via .Net Core. I\'m just using the boilerplate ValuesController as a Hello World. When I run the project, I get the following error:
The port 5001 has already used in your system. Change port number to 5002 or whatever you want.
You can add port number with .UseUrls into CreateWebHostBuilder
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseUrls("http://localhost:5002")
.UseStartup();
Or if you use visual studio code, just replace args section in .vscode -> launch.json.
"args": ["urls=http://localhost:5002"]