Setting up Habitat without having Visual Studio installed on server

Have you started checking Habitat architecture? If no, this is the best time to get started as Sitecore is evolving faster than it used to and customers are also asking competitive and best enterprise solutions. In this case sometime it becomes difficult to manage your project architecture specially in a big project/team. So, why not look at Habitat? an example provided by Sitecore as a best practice for Sitecore projects based on Helix architecture.

There are many resources available on how to setup Habitat for sitecore correctly like (source code) (Geting started guide) (step by step video tutorial on how to setup Habitat for Sitecore)

I ran into a situation where i needed to setup a Habitat on a plain server where i won’t find IIS, Visual Studio etc. installed.

So, lets get on a tour on setting up Habitat without VS installed, Issues which we might face and solutions.

  1. Install plain Sitecore: first step first. Install a plain Sitecore 8.2 Update 1 on which we will setup Habitat. We will use this later
  2. Clone/Download Habitat project: Clone the Habitat repository or download zip from
  3. Node.Js: Install latest Node.Js from
  4. Perform all the steps specified in until step 5. Or you can follow the video tutorial
  5. Now, we have arrived at the step to build and publish the solution to the Habitat Sitecore website we installed in the beginning.
  6. Without having Visual Studio installed, we cannot use Task Runner Explorer of VS. So, we have to use command window to run gulp command.

Now, you will start encountering the issues when trying to run gulp commands using command prompt. Some of issues and solutions are mentioned below:

  1. Go to the project directory where you have cloned the habitat project or downloaded and unzipped a project.
  2. Run npm gulp command in that directory on to command window.
  3. Now, if you have not installed all the required modules properly from npm and try to execute gulp task like gulp default, then it will start giving error. In my case it was cannot find module gulp-msbuild. so rather running npm gulp command in project directory, run npm install command so that it will install all the required plugins along with gulp.
  4. I tried to run the default task specified in gulpfile.js using gulp default command. And i got the error saying gulp is not recognized as internal or external command. You required gulp-cli package to be installed to run gulp command from command window. So, if it is missing and you are facing this issue than run npm install -g gulp-cli command. Now once you have installed this package you can run the gulp command as gulp default from the command window.
  5. Running gulp default command again, You may face error saying Nuget package installation failed. As VS is not installed, Nuget will not be installed by default.So, you have to install Nuget command line from or
  6. Running gulp default command again, Nuget package installation will get complete but you may face error saying Build Failed. As VS is not installed on server. So, you will required to install MSBuild tool. You can find it here:
  7. Running gulp default command again, i got error saying MSBuild – microsoft.webapplication.targets was not found issue even though we have installed MSBuild tool on the server. To resolve this, i just copied C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications folder from local to the server and tried run command again.
  8. Encountered error stdout maxbuffer exceeded, error in build gulp task.
    So, i come to know that there must be something tricky with MSBuild. It is missing something that generally shifts with VS in our local machine. I found a solution as per: We need to perform third step from the link, which says copy both the below folders from your local machine to server:

    • C:\Program Files (x86)\MSBuild
    • C:\Program Files (x86)\Reference Assemblies

    Between those two directories MSBuild and Reference Assemblies you have most everything you need to complete any build that Visual Studio can do by it self. And the above steps while simple, but not obvious, provide a nice clean build server that doesn’t require Visual Studio to operate.

Keep reading Helixian.





Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s