Unable to detect suitable environment

184 views Asked by At

I am trying to deploy my Orchard 1.9.2 project but when I run ClickToBuild I get this error. I have no clue about batch scripting but I figure it's because the batch file is trying to look for Visual Studio 11.0 or 12.0 but I'm running Visual Studio 2015 Community Edition. Even so, the files that are being referenced here don't exist in my Visual Studio 14.0 folder either.

I have no idea how to proceed.

enter image description here

2

There are 2 answers

1
Xceno On BEST ANSWER

Enhance the ClickToBuild.cmd like this

FOR %%b in (
       "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat"
       "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
       "%ProgramFiles%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" 

       "%VS120COMNTOOLS%..\..\VC\vcvarsall.bat"
       "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"
       "%ProgramFiles%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" 

       "%VS110COMNTOOLS%..\..\VC\vcvarsall.bat"
       "%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"
       "%ProgramFiles%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" 
    ) do (
    if exist %%b ( 
       call %%b x86
       goto build
    )
)

echo "Unable to detect suitable environment. Build may not succeed."

:build

SET target=%1
SET project=%2

IF "%target%" == "" SET target=Build
IF "%project%" =="" SET project=Orchard.proj

lib\nuget\nuget.exe restore .\src\Orchard.sln

msbuild /t:%target% %project%

pause

It seems the 1.9.2 Branch has no updated ClickToBuild.cmd yet. However, the updated batch file is present in 1.10.0 and dev

3
Bertrand Le Roy On

You don't need clicktobuild, but should use build Precompiled instead. See http://docs.orchardproject.net/Documentation/Building-and-deploying-Orchard-from-a-source-code-drop for full instructions on how to build from the command-line if you can't use Visual Studio.