【问题标题】:Visual Studio build: sfproj The OutputPath property is not set for projectVisual Studio 构建:sfproj 未为项目设置 OutputPath 属性
【发布时间】:2018-04-29 10:13:51
【问题描述】:

我正在尝试使用我的 4.6.1 .net 核心应用程序使用 VSTS 构建我的解决方案。我将构建配置为安装 NuGet 4.3.0 并使用 nuget restore。在此之后,我尝试使用 Visual Studio Build 进行构建,但我的 Service Fabric .sfproj 文件的标题中出现错误。

当使用与 VSTS 几乎相同的设置在本地运行 MSBuild 时,所有这些都有效。

这些命令在本地工作:

nuget.exe restore "MySolution.sln" -Verbosity Detailed -NonInteractive

msbuild.exe "MySolution.sln" /nologo /nr:false /p:AddCorrelationIds=false /p:platform="x64" /p:configuration="release" /p:VisualStudioVersion="15.0"

谢谢!

【问题讨论】:

  • 可以分享一下OneDrive上的详细日志吗? (将 system.debug 设置为 true,然后排队构建并共享此日志)
  • 您使用的是托管代理还是私有代理?
  • @DanielMann 已托管。
  • @starianchen-MSFT 我会尽快给你日志...我没有看到 system.debug,但我看到了“创建日志文件”。
  • 我想道歉,我昨天收到了这些错误。今天运行(我做了一些代码更改),我收到错误,即使在运行 Nuget Restore 之后,它在 MSBuild 期间也找不到我的包。我可能会创建一个新的 SO 问题并关闭这个问题。

标签: c# msbuild azure-devops azure-service-fabric


【解决方案1】:

确保 NuGet 包 Microsoft.VisualStudio.Azure.Fabric.MSBuild 已恢复。

对我来说,运行 msbuild /t:Restore 是不够的。除此之外还必须运行它:

$projects = Get-ChildItem -Path $RootFolder -Include *.sfproj -Recurse
foreach ($project in $projects)
{
    Write-Host "Restoring NuGet packages for project $project"

    & nuget.exe restore "$project"

    if ($LastExitCode -ne 0)
    {
        return $LastExitCode
    }
}

【讨论】:

    猜你喜欢
    • 2012-08-26
    • 2014-01-20
    • 2012-02-23
    • 1970-01-01
    • 1970-01-01
    • 2019-10-26
    • 2013-12-15
    • 1970-01-01
    相关资源
    最近更新 更多