Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine output folder of dnu/dotnet publish

When I publish my project with

dotnet publish

it outputs to a folder

bin/Debug/dnxcore50/osx.10.11-x64/publish

(or perhaps the Release equivalent)

Is it possible to determine this folder location for a postpublish script specified in the project.json file?

like image 233
Brad Robinson Avatar asked Apr 19 '16 22:04

Brad Robinson


1 Answers

Thanks to fast response on the dotnet/cli gitter channel, you can. The following variables are available:

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

Source

And here are the ones for pre/postcompile:

%compile:TargetFramework%
%compile:FullTargetFramework%
%compile:Configuration%
%compile:OutputFile%
%compile:OutputDir%
%compile:ResponseFile%
%compile:RuntimeOutputDir%
%compile:RuntimeIdentifier%
%compile:CompilerExitCode%     // postcompile only

Source

like image 169
Brad Robinson Avatar answered Oct 18 '22 07:10

Brad Robinson