Note that there are some explanatory texts on larger screens.

plurals
  1. POMSBuild fails when run via Powershell
    primarykey
    data
    text
    <p>I have an MSBuild script that I want to call from a PowerShell script as part of a deployment process. If I call the build script via a bat file all works well. If I do the exact same thing in PowerShell I get CS1668 error looking for wierd and wonderful paths that dont exist on my machine. I know I am getting into the MSBuild script as these errors are occuring from within the MSBuild script targets (logging output is showing this). The bat file and the PowerShell script reside in the same place, right next to the build script.</p> <p>Errors:</p> <blockquote> <p>error CS1668 : Warning as error : Invalid search path 'C:\Program Files\Microsoft Visual Studio 8\VC\AtlMfc\Lib' specified in 'LIB environment variable' -- 'The system cannot find the path specified. ' error CS1668 : Warning as error : Invalid search path 'C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Lib' specified in 'LIB environment variable'-- 'The system cannot find the path specified. '</p> </blockquote> <p>I have checked and neiter of these paths do NOT exist on my machine. Why would running from PowerShell change what paths MSBuild look for?</p> <p>Thanks in advance</p> <p>RhysC</p> <p>EDIT- adding in code: NB the name of the MSBuild script is AutomatedDebug.build POWERSHELL SCRIPT:</p> <pre><code>#Begining of script $CurrentPath = Split-Path (Split-Path $myinvocation.mycommand.path ) #Assign the Build script paths. 1 is for building and testsing, 1 is for deployment (to keep things clean) $MSBuildScriptBuildAndTestPath = $CurrentPath + "\Tools\AutomatedDebug.build" $MSBuildScriptDeployPath = $CurrentPath + "\Tools\Deploy.build" #Run the automated build with tests Write-Host "*** Run the automated build with tests ***" C:\Windows\Microsoft.NET\Framework\v3.5\MSbuild.exe $MSBuildScriptBuildAndTestPath "/t:AllTests" "/l:FileLogger,Microsoft.Build.Engine;logfile=AllTests.log" if($LastExitCode -ne 0) { throw "AllTests failed" } Write-Host "*** FINISHED: Run the automated build with tests ***" </code></pre> <p>Bat File</p> <pre><code>@C:\Windows\Microsoft.NET\Framework\v3.5\MSbuild.exe AutomatedDebug.build /t:AllTests /l:FileLogger,Microsoft.Build.Engine;logfile="AllTests.log" @pause enter code here </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload