Copy content files to output directory of DNX Console app via project.json

后端 未结 4 2376
抹茶落季
抹茶落季 2021-02-19 22:56

I\'ve just started working with DNX 1.0.0-rc1-update1 in VS2015. My first app is a \'Console Application (package)\' project. Everything works, except NLog logging. I suspect it

4条回答
  •  猫巷女王i
    2021-02-19 23:16

    By default all code files in a directory containing a project.json are included in the project. You can control this with the include/exclude sections of the project.json.

    More info: http://docs.asp.net/en/latest/dnx/projects.html#including-excluding-files

    You use the content section of project.json like this

    {
      "content": [
        "NLog.config"
      ]
    }
    

    Now the documentation says that the file should have been copied by default as the content default if * (wildcard for all files), but you can force it with the explicit stating of the file you want in the content section.

提交回复
热议问题