Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2017 Task Runner Explorer not running events on Publish

I have a gulp file that has 2 tasks in it 1. deletes *.html files from a directory 2. copies *.html files to a directory

I have Visual Studio 2017's Task Runner Explorer setup so that:

  • Before build runs task 1
  • After build runs task 2

If I run the tasks from Visual Studio 2017's Task Runner Explorer they work

WhenI do a Visual Studio 2017's Publish, the Task Runner Explorer events are not firing. How can we get them to fire on Publish?

like image 227
GregJF Avatar asked Aug 24 '17 08:08

GregJF


1 Answers

Not sure, why it is not working on publish. It's always special.

As an alternative you can exectute gulp explicitly on publishing. For doing this, open your publishing profile (Properties/PublishProfiles/profile.pubxml) and modify it:

<Target Name="BeforeBuild">
   <Exec Command="gulp myTask" WorkingDirectory="$(ProjectDir)" />
</Target>

Also make sure, you have installed gulp-cli via package.json or by running the following command, if not already done:

npm install -g gulp-cli
like image 182
Christian Gollhardt Avatar answered Oct 31 '22 16:10

Christian Gollhardt