2010-07-21 145 views
1

我在解决3个项目, 一个WPFApplication和2 ClassLibrary项目 当我建立的解决方案,我得到下面的错误..PSake错误执行的MSBuild命令

properties { 
    $base_dir = resolve-path . 
    $build_dir = "$base_dir\build" 
    $buildartifacts_dir = "$build_dir\BuildArtifacts" 
    $sln_file = "$base_dir\Hello.sln" 
} 

task default -depends Compile 

task Clean { 
    Write-Host "Cleaning solution" -ForegroundColor Green 
    remove-item -force -recurse $buildartifacts_dir -ErrorAction 
SilentlyContinue 
} 

task Init -depends Clean { 
    Write-Host "Creating BuildArtifacts directory" -ForegroundColor Green 
    new-item $buildartifacts_dir -itemType directory 
} 


task Compile -depend Init { 
    Write-Host "Compiling ---" $sln_file -ForegroundColor Green 
    Exec { msbuild $sln_file "/p:OutDir=$build_artifacts_dir" 
/p:Configuration=Release /v:quiet } 

} 

我得到以下错误的 - 什么我做错了吗?

C:\ WINDOWS \ Microsoft.NET \框架\ v4.0.30319 \ Microsoft.Common.targets(2868,9): 错误MSB3023:没有为复制指定的目的地。请提供“DestinationFiles”或“DestinationFolder”。 [d:\ Nusrofe \ GrokPSake2 \ ClassLibrary1的\ ClassLibrary1.csproj]

C:\的Windows \ Microsoft.NET \框架\ v4.0.30319 \ Microsoft.Common.targets(3471,9): 错误MSB4044:在“ FindUnderPath“任务没有得到 所需参数”路径“的值。 [d:\ Nusrofe \ GrokPSake2 \ ClassLibrary1的\ ClassLibrary1.csproj]

C:\的Windows \ Microsoft.NET \框架\ v4.0.30319 \ Microsoft.Common.targets(2868,9): 错误MSB3023:未有目的地指定为复制。 Ple ase提供“DestinationFiles”或“DestinationFolder”。 [d:\ Nusrofe \ GrokPSake2 \ ClassLibrary2 \ ClassLibrary2.csproj]

C:\的Windows \ Microsoft.NET \框架\ v4.0.30319 \ Microsoft.Common.targets(3471,9): 错误MSB4044:在“ FindUnderPath“任务没有得到 所需参数”路径“的值。 [d:\ Nusrofe \ GrokPSake2 \ ClassLibrary2 \ ClassLibrary2.csproj]

C:\的Windows \ Microsoft.NET \框架\ v4.0.30319 \ Microsoft.Common.targets(3471,9): 错误MSB4044:在“ FindUnderPath“任务没有得到 所需参数”路径“的值。 [d:\ Nusrofe \ GrokPSake2 \ WpfApp \ WpfApp.csproj]


build2.ps1:错误执行命令:$的msbuild sln_file “/ P:OUTDIR = $ build_artifacts_dir”/ P:配置=发布/ v:安静

谢谢 - Corku

回答

0

看起来像你的Compile任务你有你的$buildartifacts_dir v A流浪下划线良莠不齐。 MSBuild可能不知道该怎么做,因为基本上你会为OutDir传递一个空的位置。