0

I need to include a file in my build output. This file is two folders above project.json. If I specify this using "../../", the config file is copied over, but to the wrong location. Instead of being copied over to /bin/Debug/net461, it's placed two folders higher in /bin.

How do I get a file in a parent directory to be copied over to actual output folder where the dlls are placed?

"buildOptions": {
  "copyToOutput": { "includeFiles": [ "../../config.json" ] }
},
John-Luke Laue
  • 3,736
  • 3
  • 32
  • 60

1 Answers1

1

Try use this instead, it's tested way and working very well:

  "buildOptions": {
     "copyToOutput": "project.json",
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  }

You can use copy single file "copyToOutput":"name" or array "copyToOutput":["name1","name2"]. To copy directory need to use "copyToOutput":"name\\"

M. Wiśnicki
  • 6,094
  • 3
  • 23
  • 28