4

I just started to learn gulp tasks for checking javascript files. I am using ASP.NET Core Web Application(.NET Framework) project type.

I am trying to fails msbuild when the gulp task fails. Here is the task:

gulp.task('jshint', function () {
    return gulp.src('./wwwroot/lib/test/js/**/*.js')
        .pipe(jshint())
        .pipe(jshint.reporter('default'))
        .pipe(jshint.reporter("fail"));
});

Here is the only one javascript file with code:

LHG^(&^%(*&^%(*&)))

When I build the project(I binded to run task before build in the Task Runner Explorer), the task generates errors in the Error List tab. But I am getting:

========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

in the Output window. i came across this question Cancel Build if Task Runner Explorer Task Fails where it suggests to run the task from pre-build event, but the problem is this project type doesn't seem to have build tab in its Properties window. I suspect that it can be done via some json configuration file, but I can not find any related information.

enter image description here

Community
  • 1
  • 1
Giorgi Nakeuri
  • 35,155
  • 8
  • 47
  • 75

1 Answers1

0

XPROJ files do not have traditional CSPROJ pre-build/post-build events. You can specify them in project.json. I would highly recommend migrating away from XPROJ back to CSPROJ, in line with what Microsoft are doing.

Michael Fry
  • 1,090
  • 9
  • 12