Task Runner Explorer

Microsoft DevLabs Free

Provides custom task runner support to Visual Studio.

(24) Review
Visual Studio
2013
Download (31,749)
2/10/2015
0.7
View
E-mail Twitter del.icio.us Digg Facebook
Add to favorites
Description
Reviews (24)
Q and A (77)
Sign in to write a review
Sort by:

by Eric Aldinger | June 10 2015

I really like this so far. Good job.

The test output is nicer in the explorer than the output directly from the cli. I wish I knew how to capture that formatting for our build output.

I would like to access this from within the context of any js file.

I would like the option to mute warnings like ">> Local Npm module "grunt-sync" not found. Is it installed?" It should be installed IMHO, but that is a matter of debate for our team. So the warning is not of value right now.

Instead of having jshint and htmlhint directly under Tasks, perhaps move them under a general Hint level. This could enable users to either lint both at the same time, or either independently.

by Guilherme Magalhães | April 03 2015

I'm getting "object reference not set to an instance of an object" while clicking the refresh projects button... Only happens in one new Win10 machine with 2013 and 2015 installed.

Is there a way to debug the extension or get logs?

by LongDinhLe | April 01 2015

by Justin_Butler | March 30 2015

Mads -

Great extension and really helped me get some outsourced front-end code into our Visual Studio environment. In order to take this to the next level, it would be great if there were built-in support in Visual Studio for getting Gulp into the build pipeline so that we can really take advantage of this in Continuous Integration scenarios. There is a really good article about this by Steve Cadwallader on his blog, which can be found here:

http://www.codecadwallader.com/2015/03/15/integrating-gulp-into-your-tfs-builds-and-web-deploy/

Hope you consider making this part of Visual Studio's default functionality. Again thanks for your work thus far!

Justin

by KyleButler | March 03 2015

I can't get it to work. Gulp works fine from the command line, but in VS I just get "Process terminated with code 1". No idea what the problem is or how to fix it

by cslater | March 02 2015

Please fix the crash every time you size the splitter window.

by JHubSharp | February 16 2015

Awesome work. The tooling here and elsewhere in VS2015 has really renewed my focus on client-side development. Thanks!

by Pat James | February 12 2015

It is a nice idea but it completely breaks Visual Studio's git integration. To me, git is much more valuable inside VS. I can run gulp, grunt, etc just fine outside of VS with very little reduction in capability from what Task Runner Explorer offers. Not so with git. Maybe if/when this bug https://connect.microsoft.com/VisualStudio/Feedback/Details/865064 is resolved I will give it another try.

by DevDells | January 23 2015

You don't need a file save event to bind to. Just use the Grunt watcher.
Takes a little time to get Grunt integrated in your workflow, but this Task Runner makes it so much simpler.
Staying in VS makes it more transparent.

by Guido Müller | January 16 2015

Nice tool. From my perspective it would be an improvement to have a binding for a file save action to trigger a grunt task.

by Jorge Neyra | January 16 2015

This works great! I have 2 issues though. One was mentioned by another user about the tasks taking too long for the production files to be ready before publishing. My second issue is that any new files created by the tasks are not automatically included in the project.

by MaksimVi | January 08 2015

Great idea, but still needs improvements. Bindings seem to be triggered by every project inside the solution instead of just the one containing gruntfile.

by vilicvane | December 21 2014

Great to have this. And it would be great if there's a quick way to know the updates of running tasks without unfold task runner.

by LordDawnhunter | December 09 2014

Great tool but there is a small issue.
When publishing a web project, the package is created before "gulp" has finished running.
So, there is either missing files or files that are empty.

by Christiaan Rakowski | December 06 2014

by KatieArnott | November 12 2014

Can you add a gulp task to VS’s publish event?

Mads Kristensen November 18 2014
| Edit |
Delete

Yes. Your .pubxml file is actually an MSBuild file, so you can easily call any command line tool from it

by JayChase | November 06 2014

Just getting started but it seems stable and easy to use.

by Templarian | September 26 2014

No issues so far, installed it and tested it out on one of our large AngularJS projects at work without any modifications.

I wish there was a way to assign an alias to a button (on the toolbar). We have build.local and build.staging.

//Update: Yes, Hotkeys functionality would actually be better. I would probably prefer the hotkeys over a physical button (but some might like the button). (it deleted your reply when I updated this text).

by leoduran | September 17 2014

I put together a simple spike and everything worked well. Once I transitioned to a larger project the extension stopped working when I right click the Gruntfile. Do you have a place for submitting issues?

Great job with the extension. It will change the way we develop client-side code going forwards.

Take care,
Leo

Mads Kristensen September 19 2014
| Edit |
Delete

Please submit the issues under the "Q AND A" tab or send them to me directly at madsk at Microsoft com. Thanks

by jimmcslim | September 07 2014

Getting there... a great preview of what is to come.

Probably worth mentioning, especially to 'new-age front-end dev' newbs like myself, that you need to have done 'npm install -g grunt-cli' from your command line to get the Task Runner Explorer to work with Grunt... it won't parse the gruntfile.js otherwise. I think I thought that having listed grunt in the package.json devDependencies that would be sufficient, nor is doing 'npm install -g grunt' enough ,you need the cli tools (which are themselves dependent upon the grunt package). Just a trick for new players!

Mads Kristensen October 01 2014
| Edit |
Delete

I've added that to the Prerequisites section in the description. In VS14, those tools will be installed by VS so you won't have to install them separately yourself.

1 - 20 of 24 Items   
Sign in to start a discussion


  • Additional parameters for grunt?
    1 Posts | Last post Tue 5:48 PM
    • Can I add additional parameters to the grunt execution call?
      Especially I would like to have the "-force" Parameter added to the execution of grunt. 
      
  • Debug tests run via grunt?
    1 Posts | Last post Tue 5:21 PM
    • I use grunt to start a couple of unit test files.
      Is there a way how I can break into the vs Debugger from within the Tests?
  • Project as Nested Folder
    1 Posts | Last post Mon 10:39 PM
    • When I have the WebProject nested inside a folder at the soluction directory tree, the drop doesn't show up the Grunt / Gulp file. Do you have any solution for this issue? I did all organization of solution based on folders, to make stuff more clean.
      
      EX:
      
      Solution
       |--src
           |--Presentation
              |--My Web Project
       |--tst
            --Test Projects
  • Change used node version
    3 Posts | Last post June 19, 2015
    • Is there a way to change the used node version of the task runner (in VS2015)?
      
      Because grunt-sass always fails because it was installed x64 but the task runner always executes ia32 version.
    • I don't know of any "supported method" but I have done this by overriding the existing bundled node.exe which can be found in C:\Program Files (x86)\PVisualStudio\Common7\IDE\Extensions\Microsoft\Web Tools\External\node
    • Don't know about vs2013 but in vs2015 you can. see http://blogs.msdn.com/b/webdev/archive/2015/03/19/customize-external-web-tools-in-visual-studio-2015.aspx for more info.
  • Solution Platform and Solution Configuration
    4 Posts | Last post June 12, 2015
    • Is it possible to get the current solution platform and configuration (ie: Debug | Any CPU) from a grunt task?
    • I'd like to hear an answer to this topic too! Where can I define which gulpfile / gruntfile the task runner should use? And which platform it belongs to?
    • Closest I was able to get with this is to set an environment variable as a post-build task before calling gulp/grunt.  Then, in your task, you can check process.env.whatever.
      
      Pre-build event command line:
      cd $(ProjectDir)
      set NODE_ENV=$(ConfigurationName)
      gulp
      
      gulpfile.js:
      var minify = process.env.NODE_ENV === "Release";
      
      
    • Have you tried using this NuGet package? https://github.com/kmees/MSBuild.NodeTools
      
      I believe it allows you to run a Grunt/Gulp task upon build that has the current build configuration in the task name.
  • Compatibility with VS2015 Task Runner Explorer?
    2 Posts | Last post May 30, 2015
    • Hi Mads,
      
      I've noticed in the VS2015 RC that the binding comments are different:
      
      /// <binding AfterBuild='sass, browserify' ProjectOpened='watch, watchify' />
      
      vs
      
      /// <vs AfterBuild='sass, browserify' SolutionOpened='watch, watchify' />
      
      Will the two versions be compatible with each other in the future? I've noticed that in VS2013 no bindings are recognized if *both* comments are present in my gulpfile. VS2015 seemed happy enough to ignore the VS2013 binding.
    • Edit: Actually the behavior is that only the first /// comment line is read, the extension ignores any subsequent lines.
  • TRE not even showed up on the right click menu
    2 Posts | Last post May 27, 2015
    • Hi, when I right click on gruntfile.js, Task Runner Explorer is not listed in the menu. The first time I install TRE, I made a mistake by not installing grunt & gulf prior. However, I've since uninstall TRE 3 times (last time from within Visual Studio 2013.4 Professional), and TRE still not available in the right click menu.
      
      Any help, please?
    • Hi, found the solution. :) I click on View > Other Windows > Task Runner Explorer. After that, Task Runner Explorer becomes available on the right-click menu on the Gruntfile.js
  • Bug reporting
    8 Posts | Last post May 18, 2015
    • Where would be the best place to file bug report since I guess there is a better place than the Q and A?
    • For now, this is the best place to report bugs
    • When opening Task Runner Explorer it reports: "Failed to load. See ouput window (Ctrl + Alt + O) for more information.
      
      The output window reports the following:
      
      Failed to load "C:\inetpub\wwwroot\######\######\gruntfile.js"...
      Running "vs-grunt-task-reader" task
      
      The grunt file is running fine in Grunt from command line and also Grunt Launcher (1.6.5)
      
      Gruntfile.js as below:
      
      module.exports = function (grunt) {
        grunt.loadNpmTasks("grunt-ts");
        grunt.loadNpmTasks('grunt-notify');
        grunt.loadNpmTasks('grunt-contrib-watch');
        grunt.loadNpmTasks('grunt-contrib-clean');
      
        var config = {
          watch: {
            core: { files: ["ts/**/*.ts", "ts/**/*.tpl.html", "!ts/typings/**/*.ts"], tasks: ['ts:core', 'clean:core'], options: { spawn: false } },
          },
      
          clean: {
            options: { force: true },
            core: { src: ["ts/**/*.js", "ts/**/*.js.map", "*.tmp.txt"] }
          },
      
          ts: {
            core: {
              src: ["ts/**/*.ts", "!ts/typings/**/*.*"], html: ["ts/**/*.tpl.html"], reference: "ts/reference.ts", out: 'js/neo.js', options: { noImplicitAny: true, declaration: false }
            }
          }
        };
      
        var defaultTasks = [];
        defaultTasks.push('clean:core');
        defaultTasks.push('ts:core');
        defaultTasks.push('watch:core');
      
        grunt.initConfig(config);
        grunt.registerTask("default", defaultTasks);
      };
      
      I have even tried a barebone file as well, with the same result.
    • Where is the gruntfile.js located? In the root of the VS project or elsewhere? Would you be able to share your project or a smaller repro project so we can take a look and fix it?
    • Hi have the same error like Magnus.
      my gruntfile.js is located in the main Project Folder. for example : solution is in \myapp
      gruntfile is in \myapp\myapp
      my gruntfile looks like this: 
      module.exports = function(grunt) {
      
          // load the task
          grunt.loadNpmTasks("grunt-ts");
      
      
          // Configure grunt here
          grunt.initConfig({
              /**
               * Compile all TypeScript files to the Application JavaScript file
               */
              ts: {
                  dev: {
      // a particular target
                      src: ["app/**/*.ts"], // The source typescript files, http://gruntjs.com/configuring-tasks#files
                      html: ["app/**/*.html"], // The source html files, https://github.com/basarat/grunt-ts#html-2-typescript-support
                      reference: "./app/reference.ts", // If specified, generate this file that you can use for your reference management
                      out: 'app/app.js', // If specified, generate an out.src file which is the merged src file
                      watch: 'app'
                  }
              }
          });
      
          grunt.registerTask("default", ["ts:dev"]);
      
      
      };
      
      so nothing Magic and it works in a console not through Task runner. if you want i can share small part of my Project with you. just say where to send this? 
      best regards 
      Adrian
    • I am having the same issue - getting the following error:
      
      Failed to load "C:\TFS\...\gruntfile.js"...
      'grunt' is not recognized as an internal or external command,
      operable program or batch file.
      
      The gruntfile is in the root of the project, along with the project file. However, could it be that there are multiple projects in the solution? The solution file is in a different location.
      
      Another thought is that we are running Node.js, NPM, NoGit, and Grunt via Nuget packages that run locally to the project - not a global installation. Could that be a cause?
    • According to my findings, you need to have grunt.cmd in your PATH for Task Runner Explorer to work. This is not required for Grunt Launcher. Launcher seems to pickup the grunt.cmd from the .bin folder. 
    • I found an issue where VS would completely hang during solution open if a task was set to be executed during solution open, and grunt.loadNpmTasks was called more than 11 times (12 caused VS2013.4 to hang). This was reproducible on all machines, and apparently wasn't a specific NPM module. 
      
      The workaround was to use a grunt module called "load-grunt-tasks" like so:
      require('load-grunt-tasks')(grunt);
  • standard streams in console problematic?
    8 Posts | Last post May 18, 2015
    • I tried to use testem in dev mode in Task Runner Explorer and it failed saying "Fatal error: Implement me. Unknown stdin file type!" 
      
      Running the same command in the standard command prompt worked fine.
    • I should have mentioned that running testem in dev mode writes a console-based interface that the user interacts with.
    • Task Runner Explorer appears to not be able to do anything with stdin. 
      
      I have been trying to use a NPM grunt module that contains a reference to "process.stdin". Even though stdin is never used, I still get the same error message: "Warning: Implement me. Unknown stdin file type! Use --force to continue."
      
      I was able to get around it for my problem by forking the module and creating my own. The code was
      
        grunt.util.spawn({
            cmd: 'mongoimport',
                args: args,
                opts: {
                    stdio: [
                        process.stdin,
                        process.stout,
                        process.stderr
                    ]
                }
              })
      
      Instead I wrote the following and everything worked.
      
        grunt.util.spawn({
            cmd: 'mongoimport',
                args: args,
                opts: { stdio: 'inherit' }
              })
      
    • I've encountered this problem with grunt-shell. Setting the option "stdin: false" fixed it in that case. I think that's something that should be taken care of by TRE itself, as there are probably many grunt/gulp plugins that don't provide that option.
    • I get the same issue trying to run the HotTowel app from TRE - it runs fine from an actual command line
      
      For more on running HotTowel on command line:
      http://www.johnpapa.net/get-up-and-running-with-node-and-visual-studio/
      
      The closest I can come to applying the fix talked about is updating stdin: false in the default.js file - but it doesn't work:
      C:\HotTowelApp\node_modules\gulp-nodemon\node_modules\nodemon\lib\config\defaults.js
      
    • btw, I am using VS 2015 RC
      and by commenting out lines in run.js & nodemon.js that refer to process.stdin, I can get it work, but, wow, what a bad kludge
    • I found an issue where VS would completely hang during solution open if a task was set to be executed during solution open, and grunt.loadNpmTasks was called more than 11 times (12 caused VS2013.4 to hang). This was reproducible on all machines, and apparently wasn't a specific NPM module. 
      
      The workaround was to use a grunt module called "load-grunt-tasks" like so:
      require('load-grunt-tasks')(grunt);
      
    • Sorry for replying to the wrong thread :-( It was meant to be helpful to others.
  • Typescript tasks being reset on save
    1 Posts | Last post May 05, 2015
    • I am using a typescript gulpfile
      
      The "/// <binding AfterBuild='default' />" gets added to the javascript, /not/ the typescript, so when I edit my typescript gulpfile and save, the binding gets deleted.
      
      Putting the header in the both the ts/coffeescript file as well as the js file would likely solve the problem.
1 - 10 of 77 Items