【问题标题】:$(SolutionDir) MSBuild property incorrect when Building Sub Projects - FAKE F#MAKE$(SolutionDir) 构建子项目时 MSBuild 属性不正确 - FAKE F#MAKE
【发布时间】:2017-03-22 11:23:19
【问题描述】:

我有 10 个子项目,在这 10 个项目中,我正在我的 FAKE 脚本中构建 3 个项目,但我收到了一个错误,即“导入的项目”

"D:\MyProject\Project1\BuildTools\StyleCop\v4.7\StyleCop.targets" was no found . Confirm that the path in the <import> declaration is correct , and that the file exists on disk .

虽然预期的目标文件不在此位置,但当前它位于此位置 D:\MyProject\BuildTools\StyleCop\v4.7\StyleCop.targets ,

我的问题是为什么要在错误的位置搜索文件。我认为这是 $(SolutionDir) 的问题,因为 project1 csproj 文件位于此位置 D:\MyProject\Project1\Project1.csproj

以下是我的假代码:

Target "BuildApp" (fun _ ->
!! "D:\MyProject\Project1\project1.csproj"
  ++ "D:\MyProject\Project2\project2.csproj"
  ++ "D:\MyProject\Project3\project3.csproj"
  |> MSBuildRelease buildDir "Build"
  |> Log "AppBuild-Output:"

)

这是否可以在提供 csproj 文件路径的同时提供我的新解决方案目录??

【问题讨论】:

    标签: f# f#-interactive f#-3.0 f#-data f#-fake


    【解决方案1】:

    尝试使用MSBuildReleaseExt 而不是MSBuildRelease 传递属性:

    |> MSBuildReleaseExt buildDir [("SolutionDir", "path-to-your-solution.sln")] "Build"
    

    【讨论】:

    • 每个 csproj 文件中如何引用 StyleCop.targets 文件?是 $(SolutionDir) 还是硬编码的 url?
    • 像 一样使用
    猜你喜欢
    • 1970-01-01
    • 2015-12-02
    • 1970-01-01
    • 2016-03-04
    • 1970-01-01
    • 2019-01-19
    • 1970-01-01
    • 2016-11-26
    • 1970-01-01
    相关资源
    最近更新 更多