I bought the Professional Sitecore 8 Development book and I am following the Sitecore Helix architecture approach. And following the examples in the book and online I am using Gulp in the Task Runner Explorer window to build and deploy the solution. Often times when I run the "Publish-Site" Gulp task I see error codes in red that say MSBuild failed with code 1
. I have no idea what that means or how to troubleshoot it. Can anyone help me understand what that message means and how to troubleshoot it?
Here is a screen shot:
Here is the code from my gulpfile.js
var gulp = require("gulp");
var msbuild = require("gulp-msbuild");
var debug = require("gulp-debug");
var foreach = require("gulp-foreach");
var gulpConfig = require("./gulp-config.js")();
module.exports.config = gulpConfig;
gulp.task("Publish-Site", function () {
return gulp.src("./{Feature,Foundation,Project}/**/**/*.csproj")
.pipe(foreach(function (stream, file) {
return stream
.pipe(debug({ title: "Publishing" }))
.pipe(msbuild({
targets: ["Build"],
gulpConfiguration: gulpConfig.buildConfiguration,
properties: {
publishUrl: gulpConfig.webRoot,
DeployDefaultTarget: "WebPublish",
WebPublishMethod: "FileSystem",
DeployOnBuild: "true",
DeleteExistingFiles: "false",
_FindDependencies: "false"
}
}));
}));
});
EDIT: I also noticed that when I do a rebuild of the entire solution that I get a few warnings about versions of System.Web.Mvc. Below is the text of the warning in Visual Studio:
8> No way to resolve conflict between "System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35". Choosing "System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" arbitrarily. 8> Consider app.config remapping of assembly "System.Web.Mvc, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "3.0.0.0" [] to Version "5.2.3.0" [C:\Projects\SitecoreDev\Foundation\Ioc\SitecoreDev.Foundation.Ioc\bin\System.Web.Mvc.dll] to solve conflict and get rid of warning. 8>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly. In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the application configuration file: 8> SitecoreDev.Foundation.Repository -> C:\Projects\SitecoreDev\Foundation\Repository\SitecoreDev.Foundation.Repository\bin\SitecoreDev.Foundation.Repository.dll
I believe that what this is telling me is that I need to add some assembly binding redirection to the web.config of the SitecoreDev.Foundation.Repository project to resolve this. However I am not completely sure how to accomplish this in the Helix architecture. If I understand correctly I don't want to have a web.config file in any of my projects. If I do then it will overwrite the Sitecore web.config file when it copies files from the dev root to the web root. Right? So I'm not sure how to fix problems like this in a particular project in my solution.
verbosity: "minimal",
todebug
(in gulpfile.js)