在ASP.NET5中的预发布脚本中访问输出目录

时间:2016-03-02 10:14:54

标签: asp.net asp.net-core dnx project.json

project.json文件可以包含prepublish条目,以便在发布包之前执行某些脚本。根据他们的wiki,这些脚本中有几个变量,例如%project:Directory%

"scripts": {
  "prepublish": [ "dir %project:Directory%" ]
}

有没有办法访问用于发布的输入和输出目录?我在visual studio中看到了实际路径:

Publishing files to E:\Projects\WebPlatform\artifacts\bin\DemoLauncher\Release\PublishOutput
Executing command ["C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" -source:contentPath='C:\Users\xxxxx\AppData\Local\Temp\PublishTemp\DemoLauncher70\' -dest:contentPath='E:\Projects\WebPlatform\artifacts\bin\DemoLauncher\Release\PublishOutput' 

但是我似乎无法获得“prepublish”脚本中的值。我想要像:

"scripts": {
  "prepublish": [ "dir %outputDirectory%" ]
}

1 个答案:

答案 0 :(得分:1)

我们发现public class Question implements Parcelable { private final String mQuestion; private final List<String> mAnswers; private final int mCorrectAnswer; public Question(final String question, final List<String> answers, int correctAnswer) { mQuestion = question; mAnswers = answers; mCorrectAnswer = correctAnswer; } // implement parcelable interface below } 发布命令不支持此操作,但命令将替换为dnx/dnu,这将提供dotnet publish变量。

is available here和相关代码here的票证