Reputation: 4108
I took an existing ASP.NET 4/MVC 5 web site and manually converted to an ASP.NET 5/MVC 6 project.
When I got the application fully functional locally I attempted to publish to the previous web app on Azure. To do this I:
Amazingly it worked the first time. However on subsequent publish attempts I received the error:
Error : The 'prepublish' script failed with status code 1.
Looking at the output of the publish I see the following:
[13:25:07] 'min:ngAppJs' errored after 307 ms
[13:25:07] Error: EPERM, open 'C:\SCM\Holos Portal 1.0 (ASP.Net 5, MVC6)\HolosPortal\src\HolosPortal\wwwroot\ngApp\ngApp.min.js' C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.DNX.Publishing.targets(152,5): Error : The 'prepublish' script failed with status code 1.
2>Publish failed due to build errors. Check the error list for more details.
Upvotes: 1
Views: 330
Reputation: 4108
I eventually discovered that if I delete the output file (ngApp.min.js) the publish would succeed but then fail again on the next publish.
I had created a new min task for my angular app
gulp.task("min:ngAppJs", function () {
return gulp.src([paths.ngAppJs, "!" + paths.ngAppMinJs], { base: "." })
.pipe(concat(paths.concatNgAppJsDest))
.pipe(uglify())
.pipe(gulp.dest("."));
});
but I had neglected to create a cleanup task to remove the output file
gulp.task("clean:ngAppJs", function (cb) {
rimraf(paths.concatNgAppJsDest, cb);
});
gulp.task("clean", ["clean:js", "clean:ngAppJs", "clean:css"]);
Adding the clean task to gulpfile.js solved the problem.
Upvotes: 1