anchor.diff:  SETLOCAL
   SETLOCAL ENABLEDELAYEDEXPANSION
   
  +:Loop
  +if [%1]==[] GOTO Begin
  +
  +if /I [%1]==[Debug] (
  +    SET Configuration=%1
  +    GOTO Next
  +)
  +
  +if /I [%1]==[Release] (
  +    SET Configuration=%1
  +    GOTO Next
  +)
  +
  +if /I [%1]==[PROD] (
  +    SET Environment=PROD
  +    GOTO Next
  +)
  +
  +if /I [%1]==[raw] (
  +    SET SkipTemplate=true
  +    GOTO Next
  +)
  +if /I [%1]==[template] (
  +    SET UpdateTemplate=%1
  +    GOTO Next
  +)
  +
  +:Next
  +SHIFT /1
  +GOTO Loop
  +
  +:Begin
   IF NOT DEFINED VisualStudioVersion (
       IF DEFINED VS140COMNTOOLS (
           CALL "%VS140COMNTOOLS%\VsDevCmd.bat"
  -        GOTO :EnvSet
  +        GOTO EnvSet
       )
   
       ECHO Error: build.cmd requires Visual Studio 2015.
       SET ERRORLEVEL=1
  -    GOTO :Exit
  +    GOTO Exit
   )
   
   :EnvSet
   SET BuildProj=%~dp0All.sln
  -SET Configuration=%1
  -IF '%Configuration%'=='' (
  +IF [%Configuration%]==[] (
       SET Configuration=Release
   )
  -SET Environment=%2
  -IF '%Environment%'=='PROD' (
  +IF /I [%Environment%]==[PROD] (
       ECHO Updating version for PROD environment
       CALL UpdateVersion.cmd
   
  -    IF NOT '!ERRORLEVEL!'=='0' (
  +    IF NOT [!ERRORLEVEL!]==[0] (
           ECHO ERROR: Error occurs when updating version
  -        GOTO :Exit
  +        GOTO Exit
       )
  +)
  +IF /I [%UpdateTemplate%]==[template] (
  +    ECHO Updating template
  +    CALL UpdateTemplate.cmd
  +    IF NOT [!ERRORLEVEL!]==[0] (
  +        ECHO ERROR: Error occurs when updating template
  +    )
  +    GOTO Exit
  +)
  +IF /I [%SkipTemplate%]==[true] (
  +    ECHO Skip updating template
  +    GOTO CheckDnu
  +)
  +
  +:: Update template before build
  +:UpdateTemplate
  +ECHO Updating template
  +CALL UpdateTemplate.cmd
  +
  +IF NOT [!ERRORLEVEL!]==[0] (
  +    ECHO ERROR: Error occurs when updating template
  +    GOTO Exit
   )
   
   :: Check if DNU exists globally
   :: DNU is OPTIONAL
  +:CheckDnu
   WHERE dnu >NUL
  -IF NOT '%ERRORLEVEL%'=='0' (
  +IF NOT [!ERRORLEVEL!]==[0] (
       ECHO ERROR: DNU is not successfully configured.
       ECHO ERROR: Please follow http://docs.asp.net/en/latest/getting-started/installing-on-windows.html#install-the-net-version-manager-dnvm to install dnvm.
       ECHO ERROR: If dnvm is installed, use `dnvm list` to show available dnx runtime, and use `dnvm use` to select the default dnx runtime
  -    GOTO :Exit
  -)
  -
  -:: Update template before build
  -ECHO Updating template
  -CALL UpdateTemplate.cmd
  -
  -IF NOT '!ERRORLEVEL!'=='0' (
  -    ECHO ERROR: Error occurs when updating template
  -    GOTO :Exit
  +    GOTO Exit
   )
   
   :: Restore packages for .csproj projects
  
positive.code: :RestoreNormalPackage
  :: Currently version 3.3 is not compatible with our build, force to use v2.8.6
  SET CachedNuget=%LocalAppData%\NuGet\v2.8.6\NuGet.exe
  IF EXIST "%CachedNuget%" GOTO :Restore
  ECHO Downloading NuGet.exe v2.8.6...
  IF NOT EXIST "%LocalAppData%\NuGet\v2.8.6" MD "%LocalAppData%\NuGet\v2.8.6"
  powershell -NoProfile -ExecutionPolicy UnRestricted -Command "$ProgressPreference = 'SilentlyContinue'; [Net.WebRequest]::DefaultWebProxy.Credentials = [Net.CredentialCache]::DefaultCredentials; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/v2.8.6/nuget.exe' -OutFile '%CachedNuget%'"
  
  IF NOT '%ErrorLevel%'=='0' (
      ECHO ERROR: Failed downloading NuGet.exe
      GOTO :Exit
  )
  
  :Restore
  %CachedNuget% restore "%BuildProj%"
  
  IF NOT '%ErrorLevel%'=='0' (
      ECHO ERROR: Error when restoring packages for %BuildProj%
      GOTO :Exit
  )
  
  :Exit
  
negative.code: SET BuildPostfix=
  CALL :Build %*
  
  IF NOT [!ERRORLEVEL!]==[0] (
      GOTO AfterBuild
  )
  
  POPD
  