2016-08-22 15 views
3

NETStandard.Libraryバージョン1.6.0である.NETコアプロジェクトの作成を試しています。Asp .Net Core Project.jsonファイル

私はpost buildコマンドを試したかったのですが、私たちのproject.jsonファイルには作成可能な "postcompile"スクリプトがあることに気付きました。

ここにはドキュメントがあります。 https://docs.microsoft.com/en-us/dotnet/articles/core/tools/project-json

私はそうのようなJSONファイルから呼び出していますことを、.CMDファイルを作成している:、

"scripts": { 
"postcompile": ["copyFiles.cmd"] 

}

は私のCMDファイルでは、私は単純なコピーコマンドを持つことができました、私はに引っかかってい

xcopy /y "C:\Playground\test.txt" "C:\Playground\test\" 

何の変数は私のビルドOUTPのようなものへのアクセスを提供するために、この時点で今の私に利用可能であるかです。作品utディレクトリ?私はどこにでもこれを参照することができません。

ありがとうございます。

答えて

4

あなたのスクリプトで流れを制御するために使用できるコンテキスト変数の全リストは、次のとおりです。

すべてのスクリプトブロック:

%project:Directory% 
%project:Name% 
%project:Version% 

特定のコンパイル:

%compile:TargetFramework% 
%compile:FullTargetFramework% 
%compile:Configuration% 
%compile:OutputFile% 
%compile:OutputDir% 
%compile:ResponseFile% 
%compile:RuntimeOutputDir% (only available if there is runtime output) 
%compile:RuntimeIdentifier% (only availabe if there is runtime output) 
%comiple:CompilerExitCode% (only available in the postcompile script block) 

は、特定の公開:

%publish:ProjectPath% 
%publish:Configuration% 
%publish:OutputPath% 
%publish:TargetFramework% 
%publish:FullTargetFramework% 
%publish:Runtime% 

参考文献:

https://github.com/aspnet/Home/wiki/Project.json-file#scripts

Post build event depending on configuration name in new ASP.NET 5 project

+0

はそれが非常に有用であるリスト、ありがとうございます。私のスクリプトがjsonファイルの中に直接入っていれば、これらの作業ができることに気付いた。しかし、スクリプトを.cmdファイルに入れた場合、%compile:OutputDir%がもう何も分かりません。スクリプトがもはや機能しなくなりました。任意の手掛かりをどのようにそれらをcmdファイルで動作させるには? –

+0

申し訳ありません。その上では考えられません。 – Sanket

+0

@ C.Moore .cmdファイルでコマンドを実行できましたか? – Sanket

関連する問題