SHFBROOT system environment variable was not found

Topics: Developer Forum, User Forum
May 25, 2011 at 1:58 AM

Hi,

I have installed 1.9.3.1. I need to get the Sandcastle build working on a build server that will not have any installation. Sandcastle/SHFB and any dependancies will be checked into svn and the build will reference the files from the svn repository.  Unfortunatley when i attempt to set the SHFBROOT variable in my MSBuild script the build fails with the error below:

"The SHFBROOT system environment variable was not found.  This variable is usually created during installation and may require a reboot.  It has been defined temporarily for this process as: SHFBROOT=%SHFBROOT%\"

I can work arounf this by adding a the task below and calling it with a value for SHFBROOT before i call my Sandcaslte build.  It would be good if we didnt have to do this and it would just pick up the value of SHFBROOT from the build file property:

WorkAround:

  <UsingTask
    TaskName="SetEnv"
    TaskFactory="CodeTaskFactory"
    AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" >
	<ParameterGroup>
      <Variable Required="true"/>
	  <Value Required="true"/>
    </ParameterGroup>
    <Task>
      <Code Type="Fragment" Language="cs">
        <![CDATA[
        Environment.SetEnvironmentVariable(Variable, Value);
        ]]>
      </Code>
    </Task>
  </UsingTask>