Jacky
Jacky

Reputation: 3239

PublishOptions with include does not work on Debug Asp.net Core

I'm using Asp.net Core version 1.0.0-preview2-003131 in VisualStudio 2015.

The strange part is , even though my appsettings.json is added in publishOptions, it is not generated during Debug. However, it will be generated in Release version.

I'm using Visual Studio to compile and debug, not command.

My Project.json:

"publishOptions": {
  "include": [
    "appsettings.json"
  ]
}

UPDATE: Below is my BuildOptions in Project.json:

"buildOptions": {
    "emitEntryPoint": true
},

Even by adding "debugType": "full" does not help to resolve this

UPDATE: Until today I'm no longer use VS 2015 anymore. Thank you for following up on this so far.

Upvotes: 2

Views: 1070

Answers (2)

AsthaUndefined
AsthaUndefined

Reputation: 1109

Do it like this:

 "publishOptions": {
    "include": [
      "appsettings.json",
      "appsettings.Production.json",
    ]
  },

This lists all the files and folders that will be included when you publish.

Upvotes: 1

AsthaUndefined
AsthaUndefined

Reputation: 1109

You can try by adding appsettings.Production.json into this array of publishOptions.

Upvotes: 1

Related Questions