Skip to content
This repository was archived by the owner on Dec 19, 2018. It is now read-only.

ConfigureAppConfiguration not taken into account. #1334

Closed
Eilon opened this issue Feb 27, 2018 · 1 comment
Closed

ConfigureAppConfiguration not taken into account. #1334

Eilon opened this issue Feb 27, 2018 · 1 comment

Comments

@Eilon
Copy link
Contributor

Eilon commented Feb 27, 2018

From @whizkidwwe1217 on February 25, 2018 2:27

I tried to put kestrel urls into a separate json file so I don't have to recompile the project every time I change urls but the problem is that the ConfigureAppConfiguration doesn't work. I don't want to use the UseConfigurationMethod because I can't find a way to get the IHostingEnvironment to set up different settings for different environment. Putting these configurations in the Startup class doesn't seem to work either.

hosting.json
image

Doing it this way works:
image
dotnet run:

Now listening on: http://[::]:4000
Now listening on: http://[::]:5000
Now listening on: http://[::]:5001
Now listening on: http://[::]:5002
Now listening on: http://[::]:5003

But doing this will not:
image
dotnet run:

Now listening on: http://localhost:5000

If I do the first method, how do I get the Hosting Environment?
image

Copied from original issue: dotnet/aspnetcore#2903

@Tratcher
Copy link
Member

Tratcher commented Mar 1, 2018

Duplicate of #1299

@Tratcher Tratcher marked this as a duplicate of #1299 Mar 1, 2018
@Tratcher Tratcher closed this as completed Mar 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants