1

I am building my API. When I launch it it in debug mode, it launches with the file: launchSettings.json. It uses then the correct IP and port to launch. Launch with debug mode

When I build the API and run the exe file it launches with localhost. Launching EXE

What am I doing wrong?

2
  • 1
    Is it a case sensitivity issue? Is your settings file exactly named LaunchSettings.JSON? Commented Jun 16, 2020 at 7:11
  • no it is launchSettings.json My bad. I will edit the post Commented Jun 16, 2020 at 7:11

1 Answer 1

1

As far as I know, the lanchsetting,json will just work when you debugging the application in visual studio. It will not affect the exe file.

If you want to run the exe to launch with specific IP address, I suggest you could try to use UseUrls method in the CreateHostBuilder method.

More details, you could refer to this codes:

    public static IHostBuilder CreateHostBuilder(string[] args) =>
        Host.CreateDefaultBuilder(args)
            .ConfigureWebHostDefaults(webBuilder =>
            {
                webBuilder.UseStartup<Startup>().UseUrls("http://172.17.12.63:5000");
            });

Result:

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.