{"action":"opened","issue":{"url":"https://api.github.com/repos/aspnet/Home/issues/1585","repository_url":"https://api.github.com/repos/aspnet/Home","labels_url":"https://api.github.com/repos/aspnet/Home/issues/1585/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Home/issues/1585/comments","events_url":"https://api.github.com/repos/aspnet/Home/issues/1585/events","html_url":"https://github.com/aspnet/Home/issues/1585","id":161503471,"number":1585,"title":"RC2: Environment Variable being ignored when deployed to IIS, defaulting to Development","user":{"login":"peterorjeff","id":19396102,"avatar_url":"https://avatars.githubusercontent.com/u/19396102?v=3","gravatar_id":"","url":"https://api.github.com/users/peterorjeff","html_url":"https://github.com/peterorjeff","followers_url":"https://api.github.com/users/peterorjeff/followers","following_url":"https://api.github.com/users/peterorjeff/following{/other_user}","gists_url":"https://api.github.com/users/peterorjeff/gists{/gist_id}","starred_url":"https://api.github.com/users/peterorjeff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterorjeff/subscriptions","organizations_url":"https://api.github.com/users/peterorjeff/orgs","repos_url":"https://api.github.com/users/peterorjeff/repos","events_url":"https://api.github.com/users/peterorjeff/events{/privacy}","received_events_url":"https://api.github.com/users/peterorjeff/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-21T18:08:58Z","updated_at":"2016-06-21T18:08:58Z","closed_at":null,"body":"### Background\r\nI have recently upgraded my project from RC1 to RC2 and deployed it to IIS 8.5 on Windows Server 2012 R2.\r\nI then went on to test different `appsettings.json` files for Staging and Production by setting the Environment Variable, however this had no effect and the project always default to \"Development\".\r\n\r\nI have searched long and hard for a solution and read every upgrade guide and all the aspnet docs, but have not found a solution. \r\n\r\nI have set all of the following Environment variables to \"Staging\" (as I know that the name changed):\r\n\r\n- ASPNET_ENV\r\n- ASPNET_ENVIRONMENT\r\n- ASPNETCORE_ENV\r\n- ASPNETCORE_ENVIRONMENT\r\n\r\nI've confirmed this via the set command, and also by write some test code to check \r\n`Environment.GetEnvironmentVariable(\"ASPNETCORE_ENVIRONMENT\")`\r\n\r\n### Expected Result\r\n`appsetting.staging.json` would be used and that `env.IsDevelopment()` would return false. \r\n\r\n### Actual Result\r\n`appsettings.development.json` is still being used and `env.IsDevelopment()` returns true.\r\n\r\n\r\n### Further Info\r\nI am including the `builder.AddEnvironmentVariables();` in my `Startup()` method.\r\n\r\nWhen I run locally from Visual Studio and change the environment variable in the Project (ie `launchSettings.json`) it works fine, just not once I've deployed to IIS.\r\n\r\n\r\nI'm not sure if there's something I'm missing in my deployment procedure, of if this is a bug.\r\nAny help would be greatly appreciated, and please let me know if I need to post any of my code etc."}}
{"actor":{"display_login":"peterorjeff"}}