orchardcmsvisual-studio-2015orchardcms-1.9

Unable to detect suitable environment


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


Solution

  • 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