使用括号在项目文件上运行FAKE MSBUild时生成错误

时间:2014-03-11 16:52:34

标签: f# f#-fake

当我执行我的伪构建脚本时,我遇到了一个问题,即项目文件中的括号似乎分别转换为%28和%29。这会导致构建失败。

以下是我的FAKE脚本:

// include Fake lib
#I @"../tools/FAKE/tools/"
#r @"FakeLib.dll"
open Fake

let buildDir = "./.build"

let dotNet40ProjectsIncludeStr = "**/*(NET40).*proj"
let dotNet40Projects =
    !! dotNet40ProjectsIncludeStr

let dotNet45Projects =
    !! "**/*.*proj"
        -- dotNet40ProjectsIncludeStr

// Default target
Target "Default" (fun _ ->
    trace "Executed Default target"
)

Target "Build NET45" (fun _ ->
    dotNet45Projects |> Seq.iter (log << sprintf "%s%s" "Net45Projects:")
    MSBuildRelease (buildDir @@ "net45") "Build" dotNet45Projects
        |> Log "BuildNet45: "
)

Target "Build NET40" (fun _ ->
    //let projects = dotNet40Projects |> Seq.map (sprintf "%s")
    //projects |> Seq.iter (log << sprintf "%s%s" "Net40Projects:")    
    dotNet40Projects |> Seq.iter (log << sprintf "%s%s" "Net40Projects:")
    MSBuildRelease (buildDir @@ "net40") "Build" dotNet40Projects
        |> Log "BuildNet40: "
)

"Build NET40"
    ==> "Build NET45"
    ==> "Default"

// start build
RunTargetOrDefault "Default"

我得到的输出包含以下内容:

Starting Target: Build NET40 Net40Projects:C:\dev\work\My-     Company\dev\MyProject\Data\MyProject\MyProject.Data(NET40).csproj    
Net40Projects:C:\dev\work\My-Company\dev\MyProject\Data\MyProject.Data.Tests\MyProject.Data.Tests(NET40).cspr oj 
Running build failed. 
Error: 
System.IO.FileNotFoundException: Could not find file 'C:\dev\work\MyCompany\dev\MyProject\Data\MyProject.Data\MyProject.Data%28NET40%29.csproj'.

1 个答案:

答案 0 :(得分:3)

我认为这是一个错误。请在假冒的github问题跟踪器中打开一个问题。