Where to specify the local port in VS Code

I am creating an ASP.NET Core application and want to use a specific port when running debug in VS Code . The default is http:// localhost:5000 . I cannot find any setting where I would change this. When I try to specify the port parameter in the launch.json file, they warn me that it is not allowed. Is there a specific setting for specifying which port ?

+5
source share
2 answers

In Program.cs

try adding .UseUrls("http://localhost:5050")

The port number can be anything other than the specified one.

+2
source

Does it need to be removed when deployed at the production or production stage? This is not like anything other than a local developer.

+1
source

Source: https://habr.com/ru/post/1266615/


All Articles