1

I've upgraded a couple of projects from RC1 to RC2 and I'm a little confused about the deployment process. I have three appsettings files, one for dev another for staging and finally one for production.

In RC1 the publish would copy all the settings files to destination, but in RC2 only appsettings.json gets copied. I'm trying to understand what effect ASPNETCORE_ENVIRONMENT would have if only a single appsetting file is present.

Is there a way you can specify the environment name to use when using the VS 2015 publish tooling?

Mark G
  • 2,848
  • 1
  • 24
  • 32

1 Answers1

3

I just ran into the same problem. In your project.json file you can add which files/folders are included when you publish. Standard it only includes the appsettings.json. I also added appsettings.*.json so the settings for all environments are included when publishing. Not sure if this is the correct new way of doing things but it does work.

  "publishOptions": {
    "include": [
      "wwwroot",
      "Views",
      "appsettings.json",
      "appsettings.*.json",
      "web.config"
    ]
  },
  • Thanks TipOfTheHat, that was something I totally overlooked. To specify which environment to use in IIS you can follow instructions at http://stackoverflow.com/a/36836533/310601. – Mark G May 25 '16 at 15:38