我正在使用Asp.Net Core 1.0创建REST Api,并且想要在编译项目时将项目中未包含的文件复制到输出路径.
I'm creating a REST Api with Asp.Net Core 1.0 and I want to copy a file which is not in included in the project to the output path when the project is compiled.
虽然我不知道该怎么做.我试图使用"buildOptions:copyToOutput"没有任何成功.我真的无法理解在这里找到的project.json参考: docs.microsoft/zh-cn/dotnet/articles/core/tools/project-json
I can't figure out how to do it though. I have tried to use "buildOptions: copyToOutput" without any success. I can't really understand the project.json reference found here: docs.microsoft/en-us/dotnet/articles/core/tools/project-json
说我要将文件.... \ TestFolder \ Test.config复制到当前项目的输出文件夹中.我该怎么办?
Say that I want to copy the file ....\TestFolder\Test.config to the output folder of the current project. How can I do that?
推荐答案您可以指定要在编译项目时复制到buildOptions中输出的文件.
You can specify files you want to copy to output in buildOptions when project is compiled.
"buildOptions": { "copyToOutput": [ "../../../copyme.txt" ] }文件的路径是相对于project.json所在的文件夹的.就我而言:
The path to the file is relative to the folder where your project.json is residing. In my case:
Root folder: -copyme.txt -WebApplication\src\WebApplication\project.json更多推荐
在Asp.net Core 1.0项目的编译时复制文件
发布评论